CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
name_value_collection.h
1
2#pragma once
3#include <system/string.h>
4#include <system/shared_ptr.h>
5#include <system/collections/list.h>
6#include <system/collections/ienumerator.h>
7#include <system/collections/icollection.h>
8#include <system/collections/dictionary.h>
9#include <system/array.h>
10#include <cstdint>
11
12namespace System { namespace Collections { namespace Specialized {
13
15class ASPOSECPP_SHARED_CLASS NameValueCollection : public System::Collections::Generic::ICollection<System::String>
16{
19
20 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
21 RTTI_INFO_DECL();
22
23public:
25 ASPOSECPP_SHARED_API virtual System::ArrayPtr<String> get_AllKeys();
29 ASPOSECPP_SHARED_API virtual int get_Count() const override;
31 ASPOSECPP_SHARED_API virtual void Add(const String& item) override;
35 ASPOSECPP_SHARED_API virtual bool Contains(const String& item) const override;
39 ASPOSECPP_SHARED_API virtual bool Remove(const String& item) override;
41 ASPOSECPP_SHARED_API void Clear() override;
45 ASPOSECPP_SHARED_API void CopyTo(System::ArrayPtr<String> array, int32_t arrayIndex) override;
50 ASPOSECPP_SHARED_API NameValueCollection();
54 ASPOSECPP_SHARED_API void Add(const System::SharedPtr<NameValueCollection>& c);
56 ASPOSECPP_SHARED_API virtual void Add(const String& name, const String& value);
58 ASPOSECPP_SHARED_API virtual String Get(const String& name);
60 ASPOSECPP_SHARED_API virtual System::ArrayPtr<String> GetValues(const String& name);
62 ASPOSECPP_SHARED_API virtual void Set(const String& name, const String& value);
66 ASPOSECPP_SHARED_API String idx_get(const String& name);
70 ASPOSECPP_SHARED_API void idx_set(const String& name, const String& value);
72 ASPOSECPP_SHARED_API bool HasKeys();
73
75 ASPOSECPP_SHARED_API System::Details::VirtualizedIteratorBase<System::String>* virtualizeBeginIterator() override;
77 ASPOSECPP_SHARED_API System::Details::VirtualizedIteratorBase<System::String>* virtualizeEndIterator() override;
79 ASPOSECPP_SHARED_API System::Details::VirtualizedIteratorBase<System::String>* virtualizeBeginConstIterator() const override;
81 ASPOSECPP_SHARED_API System::Details::VirtualizedIteratorBase<System::String>* virtualizeEndConstIterator() const override;
82
83protected:
84#ifdef ASPOSE_GET_SHARED_MEMBERS
85 void GetSharedMembers(System::Object::shared_members_type& result) const override;
86#endif
87private:
89
90 bool get_IsReadOnly();
91
92 static String GetAsOneString(const System::SharedPtr<Generic::List<String>>& list);
93 static System::ArrayPtr<String> GetAsStringArray(const System::SharedPtr<Generic::List<String>>& list);
94};
95
96}}} // namespace System::Collections::Specialized
Interface of collection of elements. Objects of this class should only be allocated using System::Mak...
Definition: icollection.h:20
List forward declaration.
Definition: list.h:127
Collection of associated String keys and String values that can be accessed either with the key or wi...
Definition: name_value_collection.h:16
virtual bool Contains(const String &item) const override
Checks if item is present in collection.
NameValueCollection(const System::SharedPtr< NameValueCollection > &col)
Copies the entries from the specified NameValueCollection to a new NameValueCollection.
System::Details::VirtualizedIteratorBase< System::String > * virtualizeBeginIterator() override
Gets the implementation of begin iterator for the current container.
virtual bool Remove(const String &item) override
Removes specific item.
virtual void Add(const String &name, const String &value)
Adds an entry with the specified name and value.
virtual void Set(const String &name, const String &value)
Sets the value of an entry.
virtual System::ArrayPtr< String > GetValues(const String &name)
Gets the values associated with the specified key.
void Add(const System::SharedPtr< NameValueCollection > &c)
Copies the entries in the specified NameValueCollection to the current.
virtual System::SharedPtr< System::Collections::Generic::IList< String > > get_Keys()
Gets all the keys.
virtual void Add(const String &item) override
Override ICollection method - not implemented.
void CopyTo(System::ArrayPtr< String > array, int32_t arrayIndex) override
Copies collection elements into existing array elements.
virtual System::ArrayPtr< String > get_AllKeys()
Gets all the keys.
System::Details::VirtualizedIteratorBase< System::String > * virtualizeEndIterator() override
Gets the implementation of end iterator for the current container.
void idx_set(const String &name, const String &value)
Sets value of an entry.
System::SharedPtr< Generic::IEnumerator< String > > GetEnumerator() override
Gets enumerator to iterate through collection.
System::Details::VirtualizedIteratorBase< System::String > * virtualizeEndConstIterator() const override
Gets the implementation of end const iterator for the current container.
void Clear() override
Deletes all elements.
System::Details::VirtualizedIteratorBase< System::String > * virtualizeBeginConstIterator() const override
Gets the implementation of begin const iterator for the current container.
virtual String Get(const String &name)
Gets the values associated with the specified key.
bool HasKeys()
Gets a value indicating whether the NameValueCollection contains keys that are not null.
NameValueCollection()
Initializes a new instance of the NameValueCollection class that is empty.
virtual int get_Count() const override
Gets the number of key/value pairs.
String idx_get(const String &name)
Gets value at specified index.
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
Definition: db_command.h:9