16 #ifndef INCLUDE_NN_NLIB_EXI_XMLSTREAMREADER_H_ 17 #define INCLUDE_NN_NLIB_EXI_XMLSTREAMREADER_H_ 22 #if defined(_MSC_VER) && defined(nx_exi_EXPORTS) 23 #undef NLIB_VIS_PUBLIC 24 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT 47 isVersionIgnored(false),
49 tempStringMaxLength(1023) {}
53 class ExiStringAllocator;
62 kProcessingInstruction = 3,
71 PROCESSING_INSTRUCTION = 3,
90 return Create(stream, settings, al);
94 return Create(stream, settings);
98 return Create(stream, settings, al);
103 if (is_local_al_) ExiAllocator::Swap(al_);
106 ExiAllocatorSwapper swapper(al_);
110 ExiAllocatorSwapper swapper(al_);
111 return this->GetAttributeCountV();
114 ExiAllocatorSwapper swapper(al_);
115 return this->GetAttributeLocalNameV(index);
118 ExiAllocatorSwapper swapper(al_);
119 return this->GetAttributeNamespaceUriV(index);
122 ExiAllocatorSwapper swapper(al_);
123 return this->GetAttributePrefixV(index);
126 ExiAllocatorSwapper swapper(al_);
127 return this->GetAttributeTypeV(index);
130 ExiAllocatorSwapper swapper(al_);
131 return this->GetAttributeValueV(index);
135 ExiAllocatorSwapper swapper(al_);
136 return this->GetAttributeValueV(namespace_uri, local_name);
139 ExiAllocatorSwapper swapper(al_);
140 return this->GetNamespaceCountV();
143 ExiAllocatorSwapper swapper(al_);
144 return this->GetNamespacePrefixV(index);
147 ExiAllocatorSwapper swapper(al_);
148 return this->GetNamespaceUriV(index);
151 ExiAllocatorSwapper swapper(al_);
152 return this->GetElementTextV();
155 ExiAllocatorSwapper swapper(al_);
156 return this->GetLocalNameV();
159 ExiAllocatorSwapper swapper(al_);
160 return this->GetNamespaceUriV();
163 ExiAllocatorSwapper swapper(al_);
164 return this->GetPrefixV();
167 ExiAllocatorSwapper swapper(al_);
168 return this->GetTextV();
173 ExiAllocatorSwapper swapper(al_);
174 return this->NextV();
180 return state_ == START_ELEMENT || state_ == END_ELEMENT || state_ == PROCESSING_INSTRUCTION;
184 return state_ == CHARACTERS || state_ == CDATA || state_ == COMMENT ||
185 state_ == PROCESSING_INSTRUCTION;
198 state_(START_DOCUMENT) {}
200 void SetExiErrorStatus(ExiErrorStatus* p)
NLIB_NOEXCEPT { error_status_ = p; }
201 ExiErrorStatus* GetExiErrorStatus() const
NLIB_NOEXCEPT {
return error_status_; }
204 template<
class DECODER>
206 template<
class DECODER>
208 template<
class DECODER>
210 template<
class DECODER>
212 template<
class DECODER>
214 template<
class DECODER>
215 const ExiChar* GetAttributeValue_(DECODER* decoder,
const ExiChar* namespace_uri,
217 template<
class DECODER>
219 template<
class DECODER>
221 template<
class DECODER>
224 template<
class DECODER>
226 template<
class DECODER>
228 template<
class DECODER>
230 template<
class DECODER>
257 ExiErrorStatus* error_status_;
269 #if defined(_MSC_VER) && defined(nx_exi_EXPORTS) 270 #undef NLIB_VIS_PUBLIC 271 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 274 #endif // INCLUDE_NN_NLIB_EXI_XMLSTREAMREADER_H_ XmlStreamConstants Next() noexcept
ストリームから次のXMLストリームイベントを読み込みます。
static XmlStreamReader * Create(InputStream *stream, const ExiAllocatorEx &al) noexcept
オブジェクト単位のアロケータを指定してXmlStreamReaderのインスタンスを作成します。 ...
size_t GetAttributeCount() noexcept
属性の数を取得します。
文字列型のtypedefやユーティリティマクロ等が定義されています。
static XmlStreamReader * Create(InputStream *stream, const XmlStreamReaderSettings &settings) noexcept
XmlStreamReaderのインスタンスを作成します。
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
TypeName で指定されたクラスのコピーコンストラクタと代入演算子を禁止します。
const ExiChar * GetNamespacePrefix(size_t index) noexcept
名前空間宣言のプレフィックスを取得します。
const ExiChar * GetLocalName() noexcept
ローカル名を取得します。
#define NLIB_SAFE_BOOL(class_name, exp)
クラス内に安全なoperator bool()を定義します。 可能であればC++11のexplicit boolを利用します。 ...
const ExiChar * GetAttributePrefix(size_t index) noexcept
属性のプレフィックスを取得します。
読み書きするバイナリXMLのデータ保持オプションです。
const ExiChar * GetAttributeValue(const ExiChar *namespace_uri, const ExiChar *local_name) noexcept
名前空間URIとローカル名を指定して属性の値を取得します。
const ExiChar * GetAttributeLocalName(size_t index) noexcept
属性のローカル名を取得します。
const ExiChar * GetNamespaceUri(size_t index) noexcept
名前空間宣言の名前空間URIを取得します。
const ExiChar * GetPrefix() noexcept
XMLの名前空間プレフィックスを取得します。
const ExiChar * GetAttributeValue(size_t index) noexcept
属性の値を取得します。
constexpr XmlStreamReaderSettings() noexcept
デフォルト設定がセットされます。
static XmlStreamReader * Create(InputStream *stream) noexcept
XmlStreamReaderSettingsをデフォルト設定でXmlStreamReaderのインスタンスを作成します。 ...
virtual ~XmlStreamReader() noexcept
デストラクタです。
const ExiChar * GetText() noexcept
テキストデータを取得します。
const ExiChar * GetElementText() noexcept
連続したテキストイベントを読み込んで1つのテキストを返します。
int GetColumnNo() const noexcept
XmlStreamReader が指し示しているカラム番号を取得します。
Preserve preserve
各種フィデリティオプションを設定します。
const ExiChar * GetNamespaceUri() noexcept
XML名前空間のURIを取得します。
XMLストリームからの読み出しを行う抽象クラスです。
ExiErrorStatus::ErrorValue GetError() const noexcept
エラー値を取得します。
ExiErrorStatus * GetErrorStatus() const noexcept
エラー状態オブジェクトを取得します。
int GetLineNo() const noexcept
XmlStreamReader が指し示している行番号を取得します。
Alignment
読み書きするバイナリXMLのアライメントを指定します。
const ExiChar * GetAttributeNamespaceUri(size_t index) noexcept
属性の名前空間URIを取得します。
XmlStreamReader, XmlStreamWriter の各インスタンス毎に設定できるアロケータです。
size_t GetNamespaceCount() noexcept
新たに宣言された名前空間の数を取得します。
XmlProcessor
利用するXmlプロセッサの指定オプションです。
size_t tempStringMaxLength
XMLコメントとProcessingInstructionの読み込みに用いるテンポラリバッファが格納できる文字列長を指定しま...
XmlProcessor processor
バイナリXMLを読み込むかテキストXMLを読み込むか指定します。
#define NLIB_NOEXCEPT
環境に合わせてnoexcept 又は同等の定義がされます。
#define NLIB_CEXPR
利用可能であればconstexprが定義されます。そうでない場合は空文字列です。
Alignment alignment
読み込むバイナリXMLのアライメントを指定します。
bool IsStartElement() const noexcept
読み込んだデータが開始タグかどうかを取得します。
XmlStreamConstants GetEventType() const noexcept
直近のXMLストリームイベントの値を返します。
bool HasName() const noexcept
ローカル名等を取得できるかどうかを返します。
bool isVersionIgnored
読み込み時にtrueにすると、バイナリXML読み込み時にバージョンのチェックを行いません。 ...
bool IsCharacters() const noexcept
読み込んだデータがテキストノードかどうかを取得します。
XmlStreamConstants
XMLストリームの読み込みで発生したXMLストリームイベントの値です。
bool IsEndElement() const noexcept
読み込んだデータが終了タグかどうかを取得します。
void Close() noexcept
XmlStreamReaderをクローズします。基となるストリームは参照されなくなるだけでクローズされません。 ...
bool fragment
複数のルートノードを持つXML(XMLフラグメント)をサポートしたバイナリXMLを読み込みます。 ...
bool HasNext() const noexcept
次のXMLストリームイベントを取得できるかどうかを返します。
ビット単位にデータが詰められたEXIストリームを読み書きします(デフォルト)。
bool HasText() const noexcept
GetText()でテキストを取得できる状態かどうかを返します。
nlib_utf8_t ExiChar
XMLパーサーの内部文字列型のtypedefです。
XmlStreamReaderの初期化オプションとなる構造体です。