CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
capture_collection.h
1
2#ifndef _aspsoe_system_text_regularexpressions_capture_collection_h_
3#define _aspsoe_system_text_regularexpressions_capture_collection_h_
4
5#include <system/text/regularexpressions/capture.h>
6#include <system/exceptions.h>
7#include <vector>
8#include "system/cycles_detection.h"
9#include <system/collections/list.h>
10
11
12namespace System {
13namespace Text {
14namespace RegularExpressions {
15
20class ASPOSECPP_SHARED_CLASS CaptureCollection: public System::Collections::Generic::List<CapturePtr>
21{
22 friend class Match;
23
24public:
27 int get_Count() const override { return static_cast<int>(m_data.size()); }
28
32 using Base::idx_get;
34 using Base::operator[];
35
38 void Add(const CapturePtr& item) override {}
40 void Clear() override {}
44 bool Remove(const CapturePtr& item) override { return false; }
47 bool get_IsReadOnly() const override{ return true; }
50 bool get_IsSynchronized() const { return false; }
51
54 void AddCapture(const CapturePtr& item) { Base::Add(item); }
55
56protected:
58 ~CaptureCollection() override = default;
59
60 friend class Match;
61
62#ifdef ASPOSE_GET_SHARED_MEMBERS
64 virtual void GetSharedMembers(System::Object::shared_members_type& result) const override
65 {
66 Object::GetSharedMembers(result);
67 result.PopulateSharedMembers("System::Text::RegularExpressions::CaptureCollection::m_data[]", m_data);
68 }
69#endif
70
71#ifdef __DBG_FOR_EACH_MEMBER
72public:
75 void DBG_for_each_member(DBG::for_each_member_visitor &visitor) const override
76 {
77 Object::DBG_for_each_member(visitor);
78 visitor.add_self(this);
79 for_each_of_Object(this, m_data, visitor);
80 }
81
84 const char* DBG_class_name() const override { return "CaptureCollection"; }
85#endif
86
87};
88
91
92}}}
93
94#endif // _aspsoe_system_text_regularexpressions_capture_collection_h_
List forward declaration.
Definition: list.h:127
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
List of captures done by single capturing group. Objects of this class should only be allocated using...
Definition: capture_collection.h:21
void AddCapture(const CapturePtr &item)
Service method to add capture into collection.
Definition: capture_collection.h:54
bool get_IsReadOnly() const override
Marks collection as read-only.
Definition: capture_collection.h:47
int get_Count() const override
Gets number of captures.
Definition: capture_collection.h:27
~CaptureCollection() override=default
Destructor.
bool Remove(const CapturePtr &item) override
Disables collection ammendment.
Definition: capture_collection.h:44
System::Collections::Generic::List< CapturePtr > Base
Base type.
Definition: capture_collection.h:30
bool get_IsSynchronized() const
Marks collection as unsynchronized.
Definition: capture_collection.h:50
void Clear() override
Disables cleaning collection.
Definition: capture_collection.h:40
void Add(const CapturePtr &item) override
Disables collection ammendment.
Definition: capture_collection.h:38
Single match of regexp over string. Objects of this class should only be allocated using System::Make...
Definition: match.h:56
@ Text
Defines color adjustment information for text.
SharedPtr< CaptureCollection > CaptureCollectionPtr
Pointer to capture collection.
Definition: capture_collection.h:90
Definition: db_command.h:9