CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
xml_attribute_collection.h
1
2
3#pragma once
4
5#include <xml/xml_named_node_map.h>
6#include <system/array.h>
7#include <cstdint>
8
9
11namespace System
12{
13namespace Xml
14{
15class DocumentXmlWriter;
16class XmlAttribute;
17class XmlElement;
18class XmlLoader;
19class XmlNamedNodeMap;
20class XmlNode;
21class XmlNodeReaderNavigator;
22} // namespace Xml
23} // namespace System
25
26namespace System {
27
28namespace Xml {
29
34class ASPOSECPP_SHARED_CLASS XmlAttributeCollection final : public XmlNamedNodeMap
35{
38
39 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
40 ASPOSECPP_SHARED_RTTI_INFO_DECL();
41
42public:
43
46
47private:
49 friend class DocumentXmlWriter;
50 friend class XmlAttribute;
51 friend class XmlElement;
52 friend class XmlLoader;
53 friend class XmlNodeReaderNavigator;
55
56public:
57
62 ASPOSECPP_SHARED_API SharedPtr<XmlAttribute> idx_get(int32_t i);
66 ASPOSECPP_SHARED_API SharedPtr<XmlAttribute> idx_get(const String& name);
72 ASPOSECPP_SHARED_API SharedPtr<XmlAttribute> idx_get(const String& localName, const String& namespaceURI);
73
84 ASPOSECPP_SHARED_API SharedPtr<XmlNode> SetNamedItem(SharedPtr<XmlNode> node) override;
88 ASPOSECPP_SHARED_API SharedPtr<XmlAttribute> Prepend(const SharedPtr<XmlAttribute>& node);
93 ASPOSECPP_SHARED_API SharedPtr<XmlAttribute> Append(const SharedPtr<XmlAttribute>& node);
100 ASPOSECPP_SHARED_API SharedPtr<XmlAttribute> InsertBefore(const SharedPtr<XmlAttribute>& newNode, const SharedPtr<XmlAttribute>& refNode);
107 ASPOSECPP_SHARED_API SharedPtr<XmlAttribute> InsertAfter(const SharedPtr<XmlAttribute>& newNode, const SharedPtr<XmlAttribute>& refNode);
111 ASPOSECPP_SHARED_API SharedPtr<XmlAttribute> Remove(const SharedPtr<XmlAttribute>& node);
115 ASPOSECPP_SHARED_API SharedPtr<XmlAttribute> RemoveAt(int32_t i);
117 ASPOSECPP_SHARED_API void RemoveAll();
121 ASPOSECPP_SHARED_API void CopyTo(const ArrayPtr<SharedPtr<XmlAttribute>>& array, int32_t index);
122
123protected:
124
127 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAttributeCollection, CODEPORTING_ARGS(SharedPtr<XmlNode> parent));
128
129 int32_t FindNodeOffset(const SharedPtr<XmlAttribute>& node);
130 int32_t FindNodeOffsetNS(const SharedPtr<XmlAttribute>& node);
131 ASPOSECPP_SHARED_API const SharedPtr<XmlNode>& AddNode(const SharedPtr<XmlNode>& node) override;
132 ASPOSECPP_SHARED_API SharedPtr<XmlNode> InsertNodeAt(int32_t i, SharedPtr<XmlNode> node) override;
133 ASPOSECPP_SHARED_API SharedPtr<XmlNode> RemoveNodeAt(int32_t i) override;
134 void Detach(const SharedPtr<XmlAttribute>& attr);
135 void InsertParentIntoElementIdAttrMap(const SharedPtr<XmlAttribute>& attr);
136 void RemoveParentFromElementIdAttrMap(const SharedPtr<XmlAttribute>& attr);
137 int32_t RemoveDuplicateAttribute(const SharedPtr<XmlAttribute>& attr);
138 bool PrepareParentInElementIdAttrMap(const String& attrPrefix, const String& attrLocalName);
139 void ResetParentInElementIdAttrMap(const String& oldVal, const String& newVal);
140 SharedPtr<XmlAttribute> InternalAppendAttribute(const SharedPtr<XmlAttribute>& node);
142
143 virtual ASPOSECPP_SHARED_API ~XmlAttributeCollection();
144
145};
146
147} // namespace Xml
148} // namespace System
149
150
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
SharedPtr< XmlAttribute > Remove(const SharedPtr< XmlAttribute > &node)
Removes the specified attribute from the collection.
SharedPtr< XmlAttribute > idx_get(int32_t i)
Returns the attribute with the specified index.
SharedPtr< XmlAttribute > idx_get(const String &localName, const String &namespaceURI)
Returns the attribute with the specified local name and namespace Uniform Resource Identifier (URI).
SharedPtr< XmlAttribute > Prepend(const SharedPtr< XmlAttribute > &node)
Inserts the specified attribute as the first node in the collection.
SharedPtr< XmlAttribute > idx_get(const String &name)
Returns the attribute with the specified name.
void CopyTo(const ArrayPtr< SharedPtr< XmlAttribute > > &array, int32_t index)
Copies all the XmlAttribute objects from this collection into the given array.
SharedPtr< XmlAttribute > InsertBefore(const SharedPtr< XmlAttribute > &newNode, const SharedPtr< XmlAttribute > &refNode)
Inserts the specified attribute immediately before the specified reference attribute.
SharedPtr< XmlAttribute > Append(const SharedPtr< XmlAttribute > &node)
Inserts the specified attribute as the last node in the collection.
SharedPtr< XmlAttribute > RemoveAt(int32_t i)
Removes the attribute corresponding to the specified index from the collection.
SharedPtr< XmlAttribute > InsertAfter(const SharedPtr< XmlAttribute > &newNode, const SharedPtr< XmlAttribute > &refNode)
Inserts the specified attribute immediately after the specified reference attribute.
SharedPtr< XmlNode > SetNamedItem(SharedPtr< XmlNode > node) override
Adds an XmlNode using its XmlNode::get_Name result.
void RemoveAll()
Removes all attributes from the collection.
Represents an attribute. Valid and default values for the attribute are defined in a document type de...
Definition: xml_attribute.h:50
Represents an element.
Definition: xml_element.h:51
Represents a collection of nodes that can be accessed by name or index.
Definition: xml_named_node_map.h:43
@ Xml
Serialize according to the XML 1.0 rules.
Definition: db_command.h:9