私たちのプロジェクトでは、外部構成ファイル (server.xml など) を使用するアプリケーションを取得しました。ここで、C++/QT でセットアップ ツール GUI を設計して、そのような構成ファイルを読み取り/編集する必要があり、そのようなファイルのすべての異なるバージョンを処理できる必要があります。ユーザーはファイルのバージョンを選択し、編集を続行します。あるバージョンから別のバージョンへの変更はそれほど大きくありません。新しい xml タグ、別の名前または別の位置のタグがある可能性があります。
そうするための最良の設計アプローチは何ですか?標準の MVC デザイン パターンを使用する予定ですが、同じ GUI コードを何度も書き直すことなく、すべての異なる構成バージョンに対処するにはどうすればよいでしょうか?
サンプル構成ファイルは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<Server_configuration ver="11">
<core>
<enable-tms>true</enable-tms>
<enable-gui-messages>true</enable-gui-messages>
<waiting-for-config-timeout>10000</waiting-for-config-timeout>
<remoting>
<port>50000</port>
<join-timeout>5000</join-timeout>
<ismultithread>true</ismultithread>
<maxconcurrentrequests>20</maxconcurrentrequests>
</remoting>
</core>
<content>
<ftp>
<ip>192.168.0.227</ip>
<port>21</port>
<userid>******</userid>
<passwd>******</passwd>
</ftp>
<library>
<ip>192.168.0.227</ip>
<port>50023</port>
</library>
<local>
<asset-root>/assetroot</asset-root>
<kdm-expiration-warning>172800000</kdm-expiration-warning>
</local>
<hula-store-daemon>
<ip>127.0.0.1</ip>
<port>5567</port>
</hula-store-daemon>
</content>
</Server_configuration>