CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
xml_text_reader.h
1
2
3#pragma once
4
5#include <xml/xml_space.h>
6#include <xml/xml_reader.h>
7#include <xml/xml_node_type.h>
8#include <xml/xml_namespace_scope.h>
9#include <xml/whitespace_handling.h>
10#include <xml/read_state.h>
11#include <xml/ixml_namespace_resolver.h>
12#include <xml/ixml_line_info.h>
13#include <xml/entity_handling.h>
14#include <xml/dtd_processing.h>
15#include <system/array.h>
16#include <cstdint>
17
18
20namespace System
21{
22namespace Collections
23{
24namespace Generic
25{
26template <typename, typename> class IDictionary;
27} // namespace Generic
28} // namespace Collections
29namespace IO
30{
31class Stream;
32class TextReader;
33} // namespace IO
34namespace Text
35{
36class Encoding;
37} // namespace Text
38namespace Xml
39{
40class IDtdInfo;
41class XmlDocument;
42class XmlLoader;
43class XmlNamespaceManager;
44class XmlNameTable;
45class XmlParserContext;
46class XmlResolver;
47class XmlTextReaderImpl;
48class XmlValidatingReaderImpl;
49namespace Xsl
50{
51class QueryReaderSettings;
52} // namespace Xsl
53} // namespace Xml
54} // namespace System
56
57namespace System {
58
59namespace Xml {
60
66class ASPOSECPP_SHARED_CLASS XmlTextReader : public XmlReader, public IXmlLineInfo, public IXmlNamespaceResolver
67{
68 typedef XmlTextReader ThisType;
69 typedef XmlReader BaseType;
70 typedef IXmlLineInfo BaseType1;
72
73 typedef ::System::BaseTypesInfo<BaseType, BaseType1, BaseType2> ThisTypeBaseTypesInfo;
74 ASPOSECPP_SHARED_RTTI_INFO_DECL();
75
76public:
77
80
81private:
83 friend class XmlReader;
84 friend class XmlValidatingReaderImpl;
85 friend class XmlDocument;
86 friend class XmlLoader;
87 friend class Xsl::QueryReaderSettings;
89
90public:
91
94 ASPOSECPP_SHARED_API XmlNodeType get_NodeType() override;
110 ASPOSECPP_SHARED_API String get_Name() override;
115 ASPOSECPP_SHARED_API String get_LocalName() override;
118 ASPOSECPP_SHARED_API String get_NamespaceURI() override;
121 ASPOSECPP_SHARED_API String get_Prefix() override;
124 ASPOSECPP_SHARED_API bool get_HasValue() override;
141 ASPOSECPP_SHARED_API String get_Value() override;
144 ASPOSECPP_SHARED_API int32_t get_Depth() override;
147 ASPOSECPP_SHARED_API String get_BaseURI() override;
151 ASPOSECPP_SHARED_API bool get_IsEmptyElement() override;
155 ASPOSECPP_SHARED_API bool get_IsDefault() override;
158 ASPOSECPP_SHARED_API char16_t get_QuoteChar() override;
161 ASPOSECPP_SHARED_API System::Xml::XmlSpace get_XmlSpace() override;
164 ASPOSECPP_SHARED_API String get_XmlLang() override;
167 ASPOSECPP_SHARED_API int32_t get_AttributeCount() override;
170 ASPOSECPP_SHARED_API bool get_EOF() override;
173 ASPOSECPP_SHARED_API System::Xml::ReadState get_ReadState() override;
176 ASPOSECPP_SHARED_API SharedPtr<XmlNameTable> get_NameTable() override;
180 ASPOSECPP_SHARED_API bool get_CanResolveEntity() override;
184 ASPOSECPP_SHARED_API bool get_CanReadBinaryContent() override;
188 ASPOSECPP_SHARED_API bool get_CanReadValueChunk() override;
191 ASPOSECPP_SHARED_API int32_t get_LineNumber() override;
194 ASPOSECPP_SHARED_API int32_t get_LinePosition() override;
197 ASPOSECPP_SHARED_API bool get_Namespaces();
202 ASPOSECPP_SHARED_API void set_Namespaces(bool value);
205 ASPOSECPP_SHARED_API bool get_Normalization();
210 ASPOSECPP_SHARED_API void set_Normalization(bool value);
229 ASPOSECPP_SHARED_API bool get_ProhibitDtd();
233 ASPOSECPP_SHARED_API void set_ProhibitDtd(bool value);
239 ASPOSECPP_SHARED_API void set_DtdProcessing(System::Xml::DtdProcessing value);
246 ASPOSECPP_SHARED_API void set_EntityHandling(System::Xml::EntityHandling value);
249 ASPOSECPP_SHARED_API void set_XmlResolver(const SharedPtr<System::Xml::XmlResolver>& value);
250
254 ASPOSECPP_SHARED_API XmlTextReader(const SharedPtr<IO::Stream>& input);
260 ASPOSECPP_SHARED_API XmlTextReader(const String& url, const SharedPtr<IO::Stream>& input);
265 ASPOSECPP_SHARED_API XmlTextReader(const SharedPtr<IO::Stream>& input, const SharedPtr<XmlNameTable>& nt);
273 ASPOSECPP_SHARED_API XmlTextReader(const String& url, const SharedPtr<IO::Stream>& input, const SharedPtr<XmlNameTable>& nt);
276 ASPOSECPP_SHARED_API XmlTextReader(const SharedPtr<IO::TextReader>& input);
281 ASPOSECPP_SHARED_API XmlTextReader(const String& url, const SharedPtr<IO::TextReader>& input);
286 ASPOSECPP_SHARED_API XmlTextReader(const SharedPtr<IO::TextReader>& input, const SharedPtr<XmlNameTable>& nt);
294 ASPOSECPP_SHARED_API XmlTextReader(const String& url, const SharedPtr<IO::TextReader>& input, const SharedPtr<XmlNameTable>& nt);
302 ASPOSECPP_SHARED_API XmlTextReader(const SharedPtr<IO::Stream>& xmlFragment, XmlNodeType fragType, const SharedPtr<XmlParserContext>& context);
310 ASPOSECPP_SHARED_API XmlTextReader(const String& xmlFragment, XmlNodeType fragType, const SharedPtr<XmlParserContext>& context);
320 ASPOSECPP_SHARED_API XmlTextReader(const String& url);
331 ASPOSECPP_SHARED_API XmlTextReader(const String& url, const SharedPtr<XmlNameTable>& nt);
332
336 ASPOSECPP_SHARED_API String GetAttribute(String name) override;
342 ASPOSECPP_SHARED_API String GetAttribute(String localName, String namespaceURI) override;
348 ASPOSECPP_SHARED_API String GetAttribute(int32_t i) override;
353 ASPOSECPP_SHARED_API bool MoveToAttribute(String name) override;
359 ASPOSECPP_SHARED_API bool MoveToAttribute(String localName, String namespaceURI) override;
364 ASPOSECPP_SHARED_API void MoveToAttribute(int32_t i) override;
368 ASPOSECPP_SHARED_API bool MoveToFirstAttribute() override;
371 ASPOSECPP_SHARED_API bool MoveToNextAttribute() override;
375 ASPOSECPP_SHARED_API bool MoveToElement() override;
380 ASPOSECPP_SHARED_API bool ReadAttributeValue() override;
384 ASPOSECPP_SHARED_API bool Read() override;
386 ASPOSECPP_SHARED_API void Close() override;
388 ASPOSECPP_SHARED_API void Skip() override;
394 ASPOSECPP_SHARED_API String LookupNamespace(const String& prefix) override;
396 ASPOSECPP_SHARED_API void ResolveEntity() override;
406 ASPOSECPP_SHARED_API int32_t ReadContentAsBase64(ArrayPtr<uint8_t> buffer, int32_t index, int32_t count) override;
419 ASPOSECPP_SHARED_API int32_t ReadElementContentAsBase64(ArrayPtr<uint8_t> buffer, int32_t index, int32_t count) override;
430 ASPOSECPP_SHARED_API int32_t ReadContentAsBinHex(ArrayPtr<uint8_t> buffer, int32_t index, int32_t count) override;
443 ASPOSECPP_SHARED_API int32_t ReadElementContentAsBinHex(ArrayPtr<uint8_t> buffer, int32_t index, int32_t count) override;
451 ASPOSECPP_SHARED_API String ReadString() override;
454 ASPOSECPP_SHARED_API bool HasLineInfo() override;
463 ASPOSECPP_SHARED_API void ResetState();
477 ASPOSECPP_SHARED_API int32_t ReadChars(const ArrayPtr<char16_t>& buffer, int32_t index, int32_t count);
486 ASPOSECPP_SHARED_API int32_t ReadBase64(const ArrayPtr<uint8_t>& array, int32_t offset, int32_t len);
495 ASPOSECPP_SHARED_API int32_t ReadBinHex(const ArrayPtr<uint8_t>& array, int32_t offset, int32_t len);
496
497protected:
498
501 ASPOSECPP_SHARED_API SharedPtr<XmlNamespaceManager> get_NamespaceManager() override;
502 void set_XmlValidatingReaderCompatibilityMode(bool value);
503 ASPOSECPP_SHARED_API SharedPtr<IDtdInfo> get_DtdInfo() override;
505
507 ASPOSECPP_SHARED_API XmlTextReader();
508 ASPOSECPP_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlTextReader, CODEPORTING_ARGS());
509
512 ASPOSECPP_SHARED_API XmlTextReader(const SharedPtr<XmlNameTable>& nt);
514
515 virtual ASPOSECPP_SHARED_API ~XmlTextReader();
516
518 #ifdef ASPOSE_GET_SHARED_MEMBERS
519 ASPOSECPP_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
520 #endif
522
523private:
524
526
527 ASPOSECPP_SHARED_API String LookupPrefix(const String& namespaceName) override;
528
529};
530
531} // namespace Xml
532} // namespace System
533
534
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Provides an interface to enable a class to return line and position information.
Definition: ixml_line_info.h:15
Provides read-only access to a set of prefix and namespace mappings.
Definition: ixml_namespace_resolver.h:29
Represents an XML document. You can use this class to load, validate, edit, add, and position XML in ...
Definition: xml_document.h:100
Represents a reader that provides fast, noncached, forward-only access to XML data.
Definition: xml_reader.h:73
Represents a reader that provides fast, non-cached, forward-only access to XML data.
Definition: xml_text_reader.h:67
bool get_ProhibitDtd()
Returns a value indicating whether to allow DTD processing.
int32_t ReadElementContentAsBinHex(ArrayPtr< uint8_t > buffer, int32_t index, int32_t count) override
Reads the element and decodes the BinHex content.
String get_Prefix() override
Returns the namespace prefix associated with the current node.
String ReadString() override
Reads the contents of an element or a text node as a string.
String GetAttribute(String name) override
Returns the value of the attribute with the specified name.
String get_LocalName() override
Returns the local name of the current node.
bool MoveToAttribute(String localName, String namespaceURI) override
Moves to the attribute with the specified local name and namespace URI.
bool HasLineInfo() override
Returns a value indicating whether the class can return line information.
XmlTextReader(const String &xmlFragment, XmlNodeType fragType, const SharedPtr< XmlParserContext > &context)
Initializes a new instance of the XmlTextReader class with the specified string, XmlNodeType,...
MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlTextReader, CODEPORTING_ARGS(SharedPtr< XmlNameTable > nt))
void set_ProhibitDtd(bool value)
Sets a value indicating whether to allow DTD processing.
void set_EntityHandling(System::Xml::EntityHandling value)
Sets a value that specifies how the reader handles entities.
int32_t get_AttributeCount() override
Returns the number of attributes on the current node.
String GetAttribute(int32_t i) override
Returns the value of the attribute with the specified index.
XmlTextReader(const SharedPtr< IO::Stream > &input, const SharedPtr< XmlNameTable > &nt)
Initializes a new instance of the XmlTextReader class with the specified stream and XmlNameTable.
XmlTextReader(const String &url, const SharedPtr< IO::TextReader > &input)
Initializes a new instance of the XmlTextReader class with the specified URL and TextReader.
bool MoveToAttribute(String name) override
Moves to the attribute with the specified name.
SharedPtr< IO::TextReader > GetRemainder()
Returns the remainder of the buffered XML.
System::Xml::EntityHandling get_EntityHandling()
Returns a value that specifies how the reader handles entities.
String get_XmlLang() override
Returns the current xml:lang scope.
bool get_HasValue() override
Returns a value indicating whether the current node can have a XmlTextReader::get_Value other than St...
System::Xml::XmlSpace get_XmlSpace() override
Returns the current xml:space scope.
int32_t ReadBase64(const ArrayPtr< uint8_t > &array, int32_t offset, int32_t len)
Decodes Base64 and returns the decoded binary bytes.
bool get_CanReadValueChunk() override
Returns a value indicating whether the XmlTextReader implements the XmlReader::ReadValueChunk method.
XmlTextReader(const String &url, const SharedPtr< XmlNameTable > &nt)
Initializes a new instance of the XmlTextReader class with the specified file and XmlNameTable.
int32_t ReadBinHex(const ArrayPtr< uint8_t > &array, int32_t offset, int32_t len)
Decodes BinHex and returns the decoded binary bytes.
XmlTextReader(const String &url, const SharedPtr< IO::Stream > &input, const SharedPtr< XmlNameTable > &nt)
Initializes a new instance of the XmlTextReader class with the specified URL, stream and XmlNameTable...
int32_t get_Depth() override
Returns the depth of the current node in the XML document.
String get_BaseURI() override
Returns the base URI of the current node.
void ResolveEntity() override
Resolves the entity reference for EntityReference nodes.
SharedPtr< Collections::Generic::IDictionary< String, String > > GetNamespacesInScope(XmlNamespaceScope scope) override
Returns a collection that contains all namespaces currently in-scope.
int32_t ReadElementContentAsBase64(ArrayPtr< uint8_t > buffer, int32_t index, int32_t count) override
Reads the element and decodes the Base64 content.
bool ReadAttributeValue() override
Parses the attribute value into one or more Text, EntityReference, or EndEntity nodes.
String get_Name() override
Returns the qualified name of the current node.
String get_Value() override
Returns the text value of the current node.
bool Read() override
Reads the next node from the stream.
void MoveToAttribute(int32_t i) override
Moves to the attribute with the specified index.
void set_WhitespaceHandling(System::Xml::WhitespaceHandling value)
Sets a value that specifies how white space is handled.
int32_t get_LineNumber() override
Returns the current line number.
void set_Normalization(bool value)
Sets a value indicating whether to normalize white space and attribute values.
bool MoveToElement() override
Moves to the element that contains the current attribute node.
bool MoveToFirstAttribute() override
Moves to the first attribute.
MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlTextReader, CODEPORTING_ARGS())
System::Xml::WhitespaceHandling get_WhitespaceHandling()
Returns a value that specifies how white space is handled.
XmlTextReader(const SharedPtr< IO::TextReader > &input)
Initializes a new instance of the XmlTextReader class with the specified TextReader.
int32_t ReadContentAsBinHex(ArrayPtr< uint8_t > buffer, int32_t index, int32_t count) override
Reads the content and returns the BinHex decoded binary bytes.
System::Xml::DtdProcessing get_DtdProcessing()
Returns the DtdProcessing enumeration.
int32_t ReadContentAsBase64(ArrayPtr< uint8_t > buffer, int32_t index, int32_t count) override
Reads the content and returns the Base64 decoded binary bytes.
String get_NamespaceURI() override
Returns the namespace URI (as defined in the W3C Namespace specification) of the node on which the re...
void Skip() override
Skips the children of the current node.
XmlTextReader(const SharedPtr< IO::TextReader > &input, const SharedPtr< XmlNameTable > &nt)
Initializes a new instance of the XmlTextReader class with the specified TextReader and XmlNameTable.
bool get_Namespaces()
Returns a value indicating whether to do namespace support.
XmlTextReader(const String &url, const SharedPtr< IO::Stream > &input)
Initializes a new instance of the XmlTextReader class with the specified URL and stream.
bool get_Normalization()
Returns a value indicating whether to normalize white space and attribute values.
SharedPtr< System::Text::Encoding > get_Encoding()
Returns the encoding of the document.
String LookupNamespace(const String &prefix) override
Resolves a namespace prefix in the current element's scope.
XmlTextReader(const SharedPtr< IO::Stream > &input)
Initializes a new instance of the XmlTextReader class with the specified stream.
SharedPtr< XmlNameTable > get_NameTable() override
Returns the XmlNameTable associated with this implementation.
char16_t get_QuoteChar() override
Returns the quotation mark character used to enclose the value of an attribute node.
String GetAttribute(String localName, String namespaceURI) override
Returns the value of the attribute with the specified local name and namespace URI.
bool get_CanResolveEntity() override
Returns a value indicating whether this reader can parse and resolve entities.
void set_Namespaces(bool value)
Sets a value indicating whether to do namespace support.
int32_t ReadChars(const ArrayPtr< char16_t > &buffer, int32_t index, int32_t count)
Reads the text contents of an element into a character buffer. This method is designed to read large ...
XmlTextReader()
Initializes a new instance of the XmlTextReader.
XmlTextReader(const SharedPtr< XmlNameTable > &nt)
Initializes a new instance of the XmlTextReader class with the specified XmlNameTable.
XmlTextReader(const String &url, const SharedPtr< IO::TextReader > &input, const SharedPtr< XmlNameTable > &nt)
Initializes a new instance of the XmlTextReader class with the specified URL, TextReader and XmlNameT...
bool get_EOF() override
Returns a value indicating whether the reader is positioned at the end of the stream.
bool get_CanReadBinaryContent() override
Returns a value indicating whether the XmlTextReader implements the binary content read methods.
XmlTextReader(const String &url)
Initializes a new instance of the XmlTextReader class with the specified file.
bool MoveToNextAttribute() override
Moves to the next attribute.
bool get_IsDefault() override
Returns a value indicating whether the current node is an attribute that was generated from the defau...
void set_XmlResolver(const SharedPtr< System::Xml::XmlResolver > &value)
Sets the XmlResolver used for resolving DTD references.
System::Xml::ReadState get_ReadState() override
Returns the state of the reader.
XmlTextReader(const SharedPtr< IO::Stream > &xmlFragment, XmlNodeType fragType, const SharedPtr< XmlParserContext > &context)
Initializes a new instance of the XmlTextReader class with the specified stream, XmlNodeType,...
void set_DtdProcessing(System::Xml::DtdProcessing value)
Sets the DtdProcessing enumeration.
int32_t get_LinePosition() override
Returns the current line position.
void ResetState()
Resets the state of the reader to ReadState::Initial.
XmlNodeType get_NodeType() override
Returns the type of the current node.
bool get_IsEmptyElement() override
Returns a value indicating whether the current node is an empty element (for example,...
void Close() override
Changes the XmlReader::get_ReadState to Closed.
@ Text
Defines color adjustment information for text.
@ Stream
The type that supports reliable, two-way, connection-based byte streams without duplication of data a...
WhitespaceHandling
Specifies how white space is handled.
Definition: whitespace_handling.h:15
XmlSpace
Specifies the current xml:space scope.
Definition: xml_space.h:15
EntityHandling
Specifies how the XmlTextReader or XmlValidatingReader handle entities.
Definition: entity_handling.h:15
@ Xml
Serialize according to the XML 1.0 rules.
DtdProcessing
Specifies the options for processing DTDs. The DtdProcessing enumeration is used by the XmlReaderSett...
Definition: dtd_processing.h:15
ReadState
Specifies the state of the reader.
Definition: read_state.h:15
XmlNodeType
Specifies the type of node.
Definition: xml_node_type.h:15
XmlNamespaceScope
Defines the namespace scope.
Definition: xml_namespace_scope.h:15
Definition: db_command.h:9