CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
xml_validating_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/validation_type.h>
9#include <xml/read_state.h>
10#include <xml/ixml_namespace_resolver.h>
11#include <xml/ixml_line_info.h>
12#include <xml/entity_handling.h>
13#include <system/array.h>
14#include <cstdint>
15
16
18namespace System
19{
20namespace Collections
21{
22namespace Generic
23{
24template <typename, typename> class IDictionary;
25} // namespace Generic
26} // namespace Collections
27namespace IO
28{
29class Stream;
30} // namespace IO
31namespace Text
32{
33class Encoding;
34} // namespace Text
35namespace Xml
36{
37class IDtdInfo;
38namespace Schema
39{
40class XmlSchemaCollection;
41} // namespace Schema
42enum class XmlNamespaceScope;
43class XmlNameTable;
44class XmlParserContext;
45class XmlResolver;
46class XmlValidatingReaderImpl;
47namespace Xsl
48{
49class QueryReaderSettings;
50} // namespace Xsl
51} // namespace Xml
52} // namespace System
54
55namespace System {
56
57namespace Xml {
58
66class ASPOSECPP_SHARED_CLASS XmlValidatingReader : public XmlReader, public IXmlLineInfo, public IXmlNamespaceResolver
67{
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 Xsl::QueryReaderSettings;
86
87public:
88
91 ASPOSECPP_SHARED_API XmlNodeType get_NodeType() override;
106 ASPOSECPP_SHARED_API String get_Name() override;
110 ASPOSECPP_SHARED_API String get_LocalName() override;
114 ASPOSECPP_SHARED_API String get_NamespaceURI() override;
117 ASPOSECPP_SHARED_API String get_Prefix() override;
120 ASPOSECPP_SHARED_API bool get_HasValue() override;
137 ASPOSECPP_SHARED_API String get_Value() override;
140 ASPOSECPP_SHARED_API int32_t get_Depth() override;
143 ASPOSECPP_SHARED_API String get_BaseURI() override;
148 ASPOSECPP_SHARED_API bool get_IsEmptyElement() override;
153 ASPOSECPP_SHARED_API bool get_IsDefault() override;
156 ASPOSECPP_SHARED_API char16_t get_QuoteChar() override;
159 ASPOSECPP_SHARED_API System::Xml::XmlSpace get_XmlSpace() override;
162 ASPOSECPP_SHARED_API String get_XmlLang() override;
165 ASPOSECPP_SHARED_API int32_t get_AttributeCount() override;
168 ASPOSECPP_SHARED_API bool get_EOF() override;
171 ASPOSECPP_SHARED_API System::Xml::ReadState get_ReadState() override;
174 ASPOSECPP_SHARED_API SharedPtr<XmlNameTable> get_NameTable() override;
178 ASPOSECPP_SHARED_API bool get_CanResolveEntity() override;
182 ASPOSECPP_SHARED_API bool get_CanReadBinaryContent() override;
185 ASPOSECPP_SHARED_API int32_t get_LineNumber() override;
188 ASPOSECPP_SHARED_API int32_t get_LinePosition() override;
193 ASPOSECPP_SHARED_API SharedPtr<Object> get_SchemaType();
196 ASPOSECPP_SHARED_API SharedPtr<XmlReader> get_Reader();
203 ASPOSECPP_SHARED_API void set_ValidationType(System::Xml::ValidationType value);
214 ASPOSECPP_SHARED_API void set_EntityHandling(System::Xml::EntityHandling value);
218 ASPOSECPP_SHARED_API void set_XmlResolver(const SharedPtr<System::Xml::XmlResolver>& value);
221 ASPOSECPP_SHARED_API bool get_Namespaces();
224 ASPOSECPP_SHARED_API void set_Namespaces(bool value);
228
232 ASPOSECPP_SHARED_API XmlValidatingReader(const SharedPtr<XmlReader>& reader);
249 ASPOSECPP_SHARED_API XmlValidatingReader(const String& xmlFragment, XmlNodeType fragType, const SharedPtr<XmlParserContext>& context);
266 ASPOSECPP_SHARED_API XmlValidatingReader(const SharedPtr<IO::Stream>& xmlFragment, XmlNodeType fragType, const SharedPtr<XmlParserContext>& context);
267
271 ASPOSECPP_SHARED_API String GetAttribute(String name) override;
277 ASPOSECPP_SHARED_API String GetAttribute(String localName, String namespaceURI) override;
283 ASPOSECPP_SHARED_API String GetAttribute(int32_t i) override;
288 ASPOSECPP_SHARED_API bool MoveToAttribute(String name) override;
294 ASPOSECPP_SHARED_API bool MoveToAttribute(String localName, String namespaceURI) override;
299 ASPOSECPP_SHARED_API void MoveToAttribute(int32_t i) override;
303 ASPOSECPP_SHARED_API bool MoveToFirstAttribute() override;
306 ASPOSECPP_SHARED_API bool MoveToNextAttribute() override;
310 ASPOSECPP_SHARED_API bool MoveToElement() override;
315 ASPOSECPP_SHARED_API bool ReadAttributeValue() override;
318 ASPOSECPP_SHARED_API bool Read() override;
320 ASPOSECPP_SHARED_API void Close() override;
325 ASPOSECPP_SHARED_API String LookupNamespace(const String& prefix) override;
328 ASPOSECPP_SHARED_API void ResolveEntity() override;
338 ASPOSECPP_SHARED_API int32_t ReadContentAsBase64(ArrayPtr<uint8_t> buffer, int32_t index, int32_t count) override;
351 ASPOSECPP_SHARED_API int32_t ReadElementContentAsBase64(ArrayPtr<uint8_t> buffer, int32_t index, int32_t count) override;
362 ASPOSECPP_SHARED_API int32_t ReadContentAsBinHex(ArrayPtr<uint8_t> buffer, int32_t index, int32_t count) override;
375 ASPOSECPP_SHARED_API int32_t ReadElementContentAsBinHex(ArrayPtr<uint8_t> buffer, int32_t index, int32_t count) override;
380 ASPOSECPP_SHARED_API String ReadString() override;
383 ASPOSECPP_SHARED_API bool HasLineInfo() override;
384
388 template<class... Args> void ValidationEventHandler_add(Args... value)
389 {
390 throw NotImplementedException();
391 }
392
396 template<class... Args> void ValidationEventHandler_remove(Args... value)
397 {
398 throw NotImplementedException();
399 }
400
403 ASPOSECPP_SHARED_API SharedPtr<Object> ReadTypedValue();
404
405protected:
406
409 ASPOSECPP_SHARED_API SharedPtr<IDtdInfo> get_DtdInfo() override;
411
412 virtual ASPOSECPP_SHARED_API ~XmlValidatingReader();
413
415 #ifdef ASPOSE_GET_SHARED_MEMBERS
416 ASPOSECPP_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
417 #endif
419
420private:
421
423
424 ASPOSECPP_SHARED_API SharedPtr<Collections::Generic::IDictionary<String, String>> GetNamespacesInScope(XmlNamespaceScope scope) override;
425 ASPOSECPP_SHARED_API String LookupPrefix(const String& namespaceName) override;
426
427};
428
429} // namespace Xml
430} // namespace System
431
432
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 a reader that provides fast, noncached, forward-only access to XML data.
Definition: xml_reader.h:73
Represents a reader that provides document type definition (DTD), XML-Data Reduced (XDR) schema,...
Definition: xml_validating_reader.h:67
String get_Prefix() override
Returns the namespace prefix associated with the current node.
bool MoveToFirstAttribute() override
Moves to the first attribute.
int32_t ReadElementContentAsBinHex(ArrayPtr< uint8_t > buffer, int32_t index, int32_t count) override
Reads the element and decodes the BinHex content.
bool get_HasValue() override
Returns a value indicating whether the current node can have a XmlValidatingReader::get_Value other t...
void Close() override
Changes the XmlReader::get_ReadState to Closed.
int32_t get_AttributeCount() override
Returns the number of attributes on the current node.
bool MoveToAttribute(String localName, String namespaceURI) override
Moves to the attribute with the specified local name and namespace Uniform Resource Identifier (URI).
bool MoveToElement() override
Moves to the element that contains the current attribute node.
bool Read() override
Reads the next node from the stream.
bool ReadAttributeValue() override
Parses the attribute value into one or more Text, EntityReference, or EndEntity nodes.
int32_t get_LinePosition() override
Returns the current line position.
int32_t get_Depth() override
Returns the depth of the current node in the XML document.
void ValidationEventHandler_add(Args... value)
Adds an event handler for receiving information about document type definition (DTD),...
Definition: xml_validating_reader.h:388
bool get_CanResolveEntity() override
Returns a value indicating whether this reader can parse and resolve entities.
XmlValidatingReader(const SharedPtr< XmlReader > &reader)
Initializes a new instance of the XmlValidatingReader class that validates the content returned from ...
bool HasLineInfo() override
Returns a value indicating whether the class can return line information.
SharedPtr< XmlNameTable > get_NameTable() override
Returns the XmlNameTable associated with this implementation.
SharedPtr< XmlReader > get_Reader()
Returns the XmlReader used to construct this XmlValidatingReader.
String GetAttribute(String localName, String namespaceURI) override
Returns the value of the attribute with the specified local name and namespace Uniform Resource Ident...
String get_LocalName() override
Returns the local name of the current node.
String get_NamespaceURI() override
Returns the namespace Uniform Resource Identifier (URI) (as defined in the World Wide Web Consortium ...
SharedPtr< System::Text::Encoding > get_Encoding()
Returns the encoding attribute for the document.
void set_Namespaces(bool value)
Sets a value indicating whether to do namespace support.
int32_t ReadContentAsBinHex(ArrayPtr< uint8_t > buffer, int32_t index, int32_t count) override
Reads the content and returns the BinHex decoded binary bytes.
void set_EntityHandling(System::Xml::EntityHandling value)
Sets a value that specifies how the reader handles entities.
System::Xml::EntityHandling get_EntityHandling()
Returns a value that specifies how the reader handles entities.
String GetAttribute(String name) override
Returns the value of the attribute with the specified name.
int32_t ReadElementContentAsBase64(ArrayPtr< uint8_t > buffer, int32_t index, int32_t count) override
Reads the element and decodes the Base64 content.
void set_ValidationType(System::Xml::ValidationType value)
Sets a value indicating the type of validation to perform.
bool get_Namespaces()
Returns a value indicating whether to do namespace support.
System::Xml::ValidationType get_ValidationType()
Returns a value indicating the type of validation to perform.
SharedPtr< Object > get_SchemaType()
Returns a schema type object.
XmlNodeType get_NodeType() override
Returns the type of the current node.
bool MoveToNextAttribute() override
Moves to the next attribute.
String GetAttribute(int32_t i) override
Returns the value of the attribute with the specified index.
bool get_CanReadBinaryContent() override
Returns a value indicating whether the XmlValidatingReader implements the binary content read methods...
void set_XmlResolver(const SharedPtr< System::Xml::XmlResolver > &value)
Sets the XmlResolver used for resolving external document type definition (DTD) and schema location r...
String get_BaseURI() override
Returns the base URI of the current node.
String get_XmlLang() override
Returns the current xml:lang scope.
void ValidationEventHandler_remove(Args... value)
Removes an event handler for receiving information about document type definition (DTD),...
Definition: xml_validating_reader.h:396
SharedPtr< Object > ReadTypedValue()
Returns the runt-ime type for the specified XML Schema definition language (XSD) type.
String LookupNamespace(const String &prefix) override
Resolves a namespace prefix in the current element's scope.
XmlValidatingReader(const SharedPtr< IO::Stream > &xmlFragment, XmlNodeType fragType, const SharedPtr< XmlParserContext > &context)
Initializes a new instance of the XmlValidatingReader class with the specified values.
void ResolveEntity() override
Resolves the entity reference for EntityReference nodes.
String get_Name() override
Returns the qualified name of the current node.
bool get_IsEmptyElement() override
Returns a value indicating whether the current node is an empty element (for example,...
SharedPtr< Schema::XmlSchemaCollection > get_Schemas()
Returns a XmlSchemaCollection to use for validation.
char16_t get_QuoteChar() override
Returns the quotation mark character used to enclose the value of an attribute node.
System::Xml::ReadState get_ReadState() override
Returns the state of the reader.
String ReadString() override
Reads the contents of an element or text node as a string.
int32_t ReadContentAsBase64(ArrayPtr< uint8_t > buffer, int32_t index, int32_t count) override
Reads the content and returns the Base64 decoded binary bytes.
bool get_IsDefault() override
Returns a value indicating whether the current node is an attribute that was generated from the defau...
bool MoveToAttribute(String name) override
Moves to the attribute with the specified name.
XmlValidatingReader(const String &xmlFragment, XmlNodeType fragType, const SharedPtr< XmlParserContext > &context)
Initializes a new instance of the XmlValidatingReader class with the specified values.
bool get_EOF() override
Returns a value indicating whether the reader is positioned at the end of the stream.
int32_t get_LineNumber() override
Returns the current line number.
System::Xml::XmlSpace get_XmlSpace() override
Returns the current xml:space scope.
void MoveToAttribute(int32_t i) override
Moves to the attribute with the specified index.
String get_Value() override
Returns the text value of the current node.
@ Text
Defines color adjustment information for text.
@ Stream
The type that supports reliable, two-way, connection-based byte streams without duplication of data a...
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
ValidationType
Specifies the type of validation to perform.
Definition: validation_type.h:15
@ Schema
Validate according to XML Schema definition language (XSD) schemas, including inline XML Schemas....
@ Xml
Serialize according to the XML 1.0 rules.
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