CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
xml_schema_object_collection.h
1
2
3#pragma once
4
5#include <xml/schema/xml_schema_object.h>
6#include <system/details/pointer_collection_helpers.h>
7#include <system/collections/ienumerator.h>
8#include <system/collections/collection_base.h>
9#include <system/array.h>
10#include <cstdint>
11
12
14namespace System
15{
16namespace Xml
17{
18namespace Schema
19{
20class XmlSchemaComplexType;
21} // namespace Schema
22} // namespace Xml
23} // namespace System
25
26namespace System {
27
28namespace Xml {
29
30namespace Schema {
31
36class ASPOSECPP_SHARED_CLASS XmlSchemaObjectCollection : public Collections::CollectionBase<SharedPtr<System::Xml::Schema::XmlSchemaObject>>
37{
40
41 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
42 ASPOSECPP_SHARED_RTTI_INFO_DECL();
43
44public:
45
48
49private:
51 friend class XmlSchemaComplexType;
53
54public:
55
57 ASPOSECPP_SHARED_API XmlSchemaObjectCollection();
60 ASPOSECPP_SHARED_API XmlSchemaObjectCollection(const SharedPtr<XmlSchemaObject>& parent);
61
65 virtual ASPOSECPP_SHARED_API SharedPtr<XmlSchemaObject> idx_get(int32_t index);
69 virtual ASPOSECPP_SHARED_API void idx_set(int32_t index, SharedPtr<XmlSchemaObject> value);
70
82 ASPOSECPP_SHARED_API int32_t Add(const SharedPtr<XmlSchemaObject>& item);
89 ASPOSECPP_SHARED_API void Insert(int32_t index, const SharedPtr<XmlSchemaObject>& item);
93 ASPOSECPP_SHARED_API int32_t IndexOf(const SharedPtr<XmlSchemaObject>& item);
98 ASPOSECPP_SHARED_API bool Contains(const SharedPtr<XmlSchemaObject>& item);
101 ASPOSECPP_SHARED_API void Remove(const SharedPtr<XmlSchemaObject>& item);
116 ASPOSECPP_SHARED_API void CopyTo(const ArrayPtr<SharedPtr<XmlSchemaObject>>& array, int32_t index);
118 ASPOSECPP_SHARED_API void SetTemplateWeakPtr(uint32_t argument) override;
119
120protected:
121
126 ASPOSECPP_SHARED_API void OnInsert(int32_t index, const SharedPtr<XmlSchemaObject>& item) override;
132 ASPOSECPP_SHARED_API void OnSet(int32_t index, const SharedPtr<XmlSchemaObject>& oldValue,
133 const SharedPtr<XmlSchemaObject>& newValue) override;
136 ASPOSECPP_SHARED_API void OnClear() override;
141 ASPOSECPP_SHARED_API void OnRemove(int32_t index, const SharedPtr<XmlSchemaObject>& item) override;
142
146
147 virtual ASPOSECPP_SHARED_API ~XmlSchemaObjectCollection();
148
150 #ifdef ASPOSE_GET_SHARED_MEMBERS
151 ASPOSECPP_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
152 #endif
154
155private:
156
158
159 void Add(const SharedPtr<XmlSchemaObjectCollection>& collToAdd);
160
161};
162
167class ASPOSECPP_SHARED_CLASS XmlSchemaObjectEnumerator : public Collections::Generic::IEnumerator<SharedPtr<System::Xml::Schema::XmlSchemaObject>>
168{
171
172 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
173 ASPOSECPP_SHARED_RTTI_INFO_DECL();
174
175public:
176
179
180private:
182 friend class XmlSchemaObjectCollection;
184
185public:
186
189 ASPOSECPP_SHARED_API const SharedPtr<XmlSchemaObject>& get_Current() const override;
190
192 ASPOSECPP_SHARED_API void Reset() override;
195 ASPOSECPP_SHARED_API bool MoveNext() override;
197 ASPOSECPP_SHARED_API void Dispose() override;
198
201 ASPOSECPP_SHARED_API System::Details::VirtualizedIteratorBase<SharedPtr<System::Xml::Schema::XmlSchemaObject>>* CloneIterator() const override;
202
203protected:
204
207 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlSchemaObjectEnumerator, CODEPORTING_ARGS(SharedPtr<Collections::Generic::IEnumerator<SharedPtr<XmlSchemaObject>>> enumerator));
208
209 #ifdef ASPOSE_GET_SHARED_MEMBERS
210 ASPOSECPP_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
211 #endif
213
214private:
215
217 mutable SharedPtr<XmlSchemaObject> m_CurrentHolder;
218
219};
220
221} // namespace Schema
222} // namespace Xml
223} // namespace System
224
225
Provides an abstract base class for a strongly typed collection.
Definition: collection_base.h:21
Interface of enumerator which can be used to iterate through some elements. Objects of this class sho...
Definition: ienumerator.h:63
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Represents the complexType element from XML Schema as specified by the World Wide Web Consortium (W3C...
Definition: xml_schema_complex_type.h:64
A collection of XmlSchemaObjects.
Definition: xml_schema_object_collection.h:37
void SetTemplateWeakPtr(uint32_t argument) override
Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containe...
int32_t Add(const SharedPtr< XmlSchemaObject > &item)
Adds an XmlSchemaObject to the XmlSchemaObjectCollection.
virtual SharedPtr< XmlSchemaObject > idx_get(int32_t index)
Returns the XmlSchemaObject at the specified index.
void OnSet(int32_t index, const SharedPtr< XmlSchemaObject > &oldValue, const SharedPtr< XmlSchemaObject > &newValue) override
OnSet is invoked before the standard Set behavior. For more information, see CollectionBase::OnSet me...
XmlSchemaObjectCollection()
Initializes a new instance of the XmlSchemaObjectCollection class.
void OnInsert(int32_t index, const SharedPtr< XmlSchemaObject > &item) override
OnInsert is invoked before the standard Insert behavior. For more information, see CollectionBase::On...
void OnRemove(int32_t index, const SharedPtr< XmlSchemaObject > &item) override
OnRemove is invoked before the standard Remove behavior. For more information, see CollectionBase::On...
void Remove(const SharedPtr< XmlSchemaObject > &item)
Removes an XmlSchemaObject from the XmlSchemaObjectCollection.
void OnClear() override
OnClear is invoked before the standard Clear behavior. For more information, see CollectionBase::OnCl...
SharedPtr< Collections::Generic::IEnumerator< SharedPtr< XmlSchemaObject > > > GetEnumerator() override
Returns an enumerator for iterating through the XmlSchemaObjects contained in the XmlSchemaObjectColl...
void CopyTo(const ArrayPtr< SharedPtr< XmlSchemaObject > > &array, int32_t index)
Copies all the XmlSchemaObjects from the collection into the given array, starting at the given index...
virtual void idx_set(int32_t index, SharedPtr< XmlSchemaObject > value)
Sets the XmlSchemaObject at the specified index.
bool Contains(const SharedPtr< XmlSchemaObject > &item)
Indicates if the specified XmlSchemaObject is in the XmlSchemaObjectCollection.
XmlSchemaObjectCollection(const SharedPtr< XmlSchemaObject > &parent)
Initializes a new instance of the XmlSchemaObjectCollection class that takes an XmlSchemaObject.
int32_t IndexOf(const SharedPtr< XmlSchemaObject > &item)
Returns the collection index corresponding to the specified XmlSchemaObject.
void Insert(int32_t index, const SharedPtr< XmlSchemaObject > &item)
Inserts an XmlSchemaObject to the XmlSchemaObjectCollection.
Represents the enumerator for the XmlSchemaObjectCollection.
Definition: xml_schema_object_collection.h:168
System::Details::VirtualizedIteratorBase< SharedPtr< System::Xml::Schema::XmlSchemaObject > > * CloneIterator() const override
Clones current iterator.
void Reset() override
Resets the enumerator to the start of the collection.
bool MoveNext() override
Moves to the next item in the collection.
const SharedPtr< XmlSchemaObject > & get_Current() const override
Returns the current XmlSchemaObject in the collection.
@ Schema
Validate according to XML Schema definition language (XSD) schemas, including inline XML Schemas....
@ Xml
Serialize according to the XML 1.0 rules.
Definition: db_command.h:9