MQXmlDocumentクラス

(new in Rev4.10)

MQXmlDocumentクラスはXMLドキュメントを管理するクラスです。

プラグインからはこのクラスを通じて、XMLファイルの読み書きとそのデータ要素の編集を行うことができます。


MQXmlDocument MQXmlDocument::Create();

XMLドキュメントを作成します。

MQXmlDocument型はMQCXmlDocument型のポインタなので、実際には

MQXmlDocument doc = MQCXmlDocument::Create();

のように記述します。

作成したドキュメントは必ず DeleteThis() で削除する必要があります。


void MQXmlDocument::DeleteThis();

ドキュメントを削除します。


MQXmlElement MQXmlDocument::CreateRootElement(const char *name);
MQXmlElement MQXmlDocument::CreateRootElement(const wchar_t *name);

name
ルート要素名
戻り値
ルートXML要素

保存用ドキュメントのルート要素を作成します。


MQXmlElement MQXmlDocument::GetRootElement();

戻り値
ルートXML要素(なければNULL)

ドキュメントのルート要素を返します。


BOOL MQXmlDocument::LoadFile(const char *filename);
BOOL MQXmlDocument::LoadFile(const wchar_t *filename);

filename
ファイル名
戻り値
成功可否

指定したXMLファイルを読み込みます。

XMLファイルのエンコーディングはUTF-8またはUTF-16である必要があります。それ以外のエンコーディングには対応していません。


BOOL MQXmlDocument::SaveFile(const char *filename);
BOOL MQXmlDocument::SaveFile(const wchar_t *filename);

filename
ファイル名
戻り値
成功可否

指定したファイル名でXMLファイルを保存します。