CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
xml_attribute.h
1
2
3#pragma once
4
5#include <xml/xml_node_type.h>
6#include <xml/xml_node.h>
7#include <system/shared_ptr.h>
8#include <cstdint>
9
10
12namespace System
13{
14class String;
15namespace Xml
16{
17class DocumentSchemaValidator;
18class DocumentXPathNavigator;
19namespace Schema
20{
21class IXmlSchemaInfo;
22class XsdBuilder;
23} // namespace Schema
24class XmlAttributeCollection;
25class XmlDocument;
26class XmlElement;
27class XmlLinkedNode;
28class XmlLoader;
29class XmlName;
30enum class XmlSpace;
31class XmlUnspecifiedAttribute;
32class XmlWriter;
33namespace XPath
34{
35enum class XPathNodeType;
36} // namespace XPath
37} // namespace Xml
38} // namespace System
40
41namespace System {
42
43namespace Xml {
44
49class ASPOSECPP_SHARED_CLASS XmlAttribute : public XmlNode
50{
51 typedef XmlAttribute ThisType;
52 typedef XmlNode BaseType;
53
54 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
55 ASPOSECPP_SHARED_RTTI_INFO_DECL();
56
57public:
58
61
62private:
64 friend class DocumentSchemaValidator;
65 friend class DocumentXPathNavigator;
66 friend class XmlAttributeCollection;
67 friend class XmlDocument;
68 friend class XmlLoader;
69 friend class XmlUnspecifiedAttribute;
70 friend class Schema::XsdBuilder;
72
73public:
74
77 ASPOSECPP_SHARED_API String get_Name() override;
81 ASPOSECPP_SHARED_API String get_LocalName() override;
85 ASPOSECPP_SHARED_API String get_NamespaceURI() override;
88 ASPOSECPP_SHARED_API String get_Prefix() override;
98 ASPOSECPP_SHARED_API void set_Prefix(String value) override;
101 ASPOSECPP_SHARED_API XmlNodeType get_NodeType() override;
104 ASPOSECPP_SHARED_API SharedPtr<XmlDocument> get_OwnerDocument() override;
108 ASPOSECPP_SHARED_API String get_Value() override;
112 ASPOSECPP_SHARED_API void set_Value(String value) override;
115 ASPOSECPP_SHARED_API SharedPtr<Schema::IXmlSchemaInfo> get_SchemaInfo() override;
118 ASPOSECPP_SHARED_API void set_InnerText(String value) override;
122 virtual ASPOSECPP_SHARED_API bool get_Specified();
125 virtual ASPOSECPP_SHARED_API SharedPtr<XmlElement> get_OwnerElement();
129 ASPOSECPP_SHARED_API void set_InnerXml(String value) override;
134 ASPOSECPP_SHARED_API String get_BaseURI() override;
135
139 ASPOSECPP_SHARED_API SharedPtr<XmlNode> CloneNode(bool deep) override;
149 ASPOSECPP_SHARED_API SharedPtr<XmlNode> InsertBefore(SharedPtr<XmlNode> newChild, SharedPtr<XmlNode> refChild) override;
159 ASPOSECPP_SHARED_API SharedPtr<XmlNode> InsertAfter(SharedPtr<XmlNode> newChild, SharedPtr<XmlNode> refChild) override;
169 ASPOSECPP_SHARED_API SharedPtr<XmlNode> ReplaceChild(SharedPtr<XmlNode> newChild, SharedPtr<XmlNode> oldChild) override;
174 ASPOSECPP_SHARED_API SharedPtr<XmlNode> RemoveChild(SharedPtr<XmlNode> oldChild) override;
183 ASPOSECPP_SHARED_API SharedPtr<XmlNode> PrependChild(SharedPtr<XmlNode> newChild) override;
191 ASPOSECPP_SHARED_API SharedPtr<XmlNode> AppendChild(SharedPtr<XmlNode> newChild) override;
194 ASPOSECPP_SHARED_API void WriteTo(const SharedPtr<XmlWriter>& w) override;
197 ASPOSECPP_SHARED_API void WriteContentTo(const SharedPtr<XmlWriter>& w) override;
198
199protected:
200
202 int32_t get_LocalNameHash();
204 void set_XmlName(const SharedPtr<System::Xml::XmlName>& value);
205 ASPOSECPP_SHARED_API SharedPtr<XmlNode> get_ParentNodeInternal() override;
206 ASPOSECPP_SHARED_API bool get_IsContainer() override;
207 ASPOSECPP_SHARED_API SharedPtr<XmlLinkedNode> get_LastNode() override;
208 ASPOSECPP_SHARED_API void set_LastNode(SharedPtr<XmlLinkedNode> value) override;
209 ASPOSECPP_SHARED_API System::Xml::XmlSpace get_XmlSpace() override;
210 ASPOSECPP_SHARED_API String get_XmlLang() override;
211 ASPOSECPP_SHARED_API XPath::XPathNodeType get_XPNodeType() override;
212 ASPOSECPP_SHARED_API String get_XPLocalName() override;
213 bool get_IsNamespace();
214
216 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAttribute, CODEPORTING_ARGS(const SharedPtr<System::Xml::XmlName>& name, const SharedPtr<XmlDocument>& doc));
218
224 ASPOSECPP_SHARED_API XmlAttribute(const String& prefix, const String& localName, const String& namespaceURI, const SharedPtr<XmlDocument>& doc);
225 ASPOSECPP_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAttribute, CODEPORTING_ARGS(const String& prefix, const String& localName, const String& namespaceURI, const SharedPtr<XmlDocument>& doc));
226
228 bool PrepareOwnerElementInElementIdAttrMap();
229 void ResetOwnerElementInElementIdAttrMap(const String& oldInnerText);
230 ASPOSECPP_SHARED_API SharedPtr<XmlNode> AppendChildForLoad(const SharedPtr<XmlNode>& newChild, const SharedPtr<XmlDocument>& doc) override;
231 ASPOSECPP_SHARED_API bool IsValidChildType(XmlNodeType type) override;
232 ASPOSECPP_SHARED_API void SetParent(SharedPtr<XmlNode> node) override;
234
235 virtual ASPOSECPP_SHARED_API ~XmlAttribute();
236
238 #ifdef ASPOSE_GET_SHARED_MEMBERS
239 ASPOSECPP_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
240 #endif
242
243private:
244
246 SharedPtr<XmlLinkedNode> _lastChild;
247
248};
249
250} // namespace Xml
251} // namespace System
252
253
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
Represents a collection of attributes that can be accessed by name or index.
Definition: xml_attribute_collection.h:35
Represents an attribute. Valid and default values for the attribute are defined in a document type de...
Definition: xml_attribute.h:50
virtual bool get_Specified()
Returns a value indicating whether the attribute value was explicitly set.
String get_NamespaceURI() override
Returns the namespace URI of this node.
String get_Value() override
Returns the value of the node.
SharedPtr< XmlNode > InsertBefore(SharedPtr< XmlNode > newChild, SharedPtr< XmlNode > refChild) override
Inserts the specified node immediately before the specified reference node.
void WriteContentTo(const SharedPtr< XmlWriter > &w) override
Saves all the children of the node to the specified XmlWriter.
SharedPtr< XmlDocument > get_OwnerDocument() override
Returns the XmlDocument to which this node belongs.
virtual SharedPtr< XmlElement > get_OwnerElement()
Returns the XmlElement to which the attribute belongs.
SharedPtr< Schema::IXmlSchemaInfo > get_SchemaInfo() override
Returns the post-schema-validation-infoset that has been assigned to this node as a result of schema ...
void set_InnerXml(String value) override
Sets the value of the attribute.
void WriteTo(const SharedPtr< XmlWriter > &w) override
Saves the node to the specified XmlWriter.
String get_Name() override
Returns the qualified name of the node.
MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAttribute, CODEPORTING_ARGS(const String &prefix, const String &localName, const String &namespaceURI, const SharedPtr< XmlDocument > &doc))
SharedPtr< XmlNode > AppendChild(SharedPtr< XmlNode > newChild) override
Adds the specified node to the end of the list of child nodes, of this node.
void set_Value(String value) override
Sets the value of the node.
SharedPtr< XmlNode > ReplaceChild(SharedPtr< XmlNode > newChild, SharedPtr< XmlNode > oldChild) override
Replaces the child node specified with the new child node specified.
void set_InnerText(String value) override
Sets the concatenated values of the node and all its children.
SharedPtr< XmlNode > RemoveChild(SharedPtr< XmlNode > oldChild) override
Removes the specified child node.
String get_BaseURI() override
Returns the base Uniform Resource Identifier (URI) of the node.
void set_Prefix(String value) override
Sets the namespace prefix of this node.
SharedPtr< XmlNode > PrependChild(SharedPtr< XmlNode > newChild) override
Adds the specified node to the beginning of the list of child nodes for this node.
XmlNodeType get_NodeType() override
Returns the type of the current node.
SharedPtr< XmlNode > InsertAfter(SharedPtr< XmlNode > newChild, SharedPtr< XmlNode > refChild) override
Inserts the specified node immediately after the specified reference node.
String get_Prefix() override
Returns the namespace prefix of this node.
SharedPtr< XmlNode > CloneNode(bool deep) override
Creates a duplicate of this node.
String get_LocalName() override
Returns the local name of the node.
XmlAttribute(const String &prefix, const String &localName, const String &namespaceURI, const SharedPtr< XmlDocument > &doc)
Initializes a new instance of the XmlAttribute class.
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 single node in the XML document.
Definition: xml_node.h:75
XPathNodeType
Defines the XPath node types that can be returned from the XPathNavigator class.
Definition: xpath_node_type.h:17
XmlSpace
Specifies the current xml:space scope.
Definition: xml_space.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.
XmlNodeType
Specifies the type of node.
Definition: xml_node_type.h:15
Definition: db_command.h:9