CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
xml_char_type.h
1#pragma once
2
3#include <system/exceptions.h>
4#include <system/array.h>
5#include <cstdint>
6
7
9namespace System
10{
11namespace Xml
12{
13class CharEntityEncoderFallbackBuffer;
14class DtdParser;
15class HtmlEncodedRawTextWriter;
16class HtmlUtf8RawTextWriter;
17namespace Schema
18{
19class Parser;
20class XmlSchemaValidator;
21} // namespace Schema
22class Ucs4Decoder;
23class Ucs4Decoder1234;
24class Ucs4Decoder2143;
25class Ucs4Decoder3412;
26class Ucs4Decoder4321;
27class XmlAutoDetectWriter;
28class XmlCharacterData;
29class XmlCharCheckingReader;
30class XmlCharCheckingWriter;
31class XmlConvert;
32class XmlDeclaration;
33class XmlEncodedRawTextWriter;
34class Details_XmlException; using XmlException = System::ExceptionWrapper<Details_XmlException>;
35class XmlSqlBinaryReader;
36class XmlTextEncoder;
37class XmlTextReaderImpl;
38class XmlTextWriter;
39class XmlUtf8RawTextWriter;
40class XmlWellFormedWriter;
41namespace Xsl
42{
43namespace XsltOld
44{
45class BuilderInfo;
46class Compiler;
47class ReaderOutput;
48class SequentialOutput;
49} // namespace XsltOld
50} // namespace Xsl
51} // namespace Xml
52} // namespace System
54
55namespace System {
56
57namespace Xml {
58
60class ASPOSECPP_SHARED_CLASS XmlCharType : public System::Object
61{
62 typedef XmlCharType ThisType;
64
65 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
66 ASPOSECPP_SHARED_RTTI_INFO_DECL();
67
69 friend class XmlSqlBinaryReader;
70 friend class CharEntityEncoderFallbackBuffer;
71 friend class HtmlEncodedRawTextWriter;
72 friend class XmlEncodedRawTextWriter;
73 friend class HtmlUtf8RawTextWriter;
74 friend class XmlUtf8RawTextWriter;
75 friend class XmlAutoDetectWriter;
76 friend class XmlCharCheckingReader;
77 friend class XmlCharCheckingWriter;
78 friend class XmlTextEncoder;
79 friend class XmlTextReaderImpl;
80 friend class XmlTextWriter;
81 friend class XmlWellFormedWriter;
82 friend class XmlCharacterData;
83 friend class XmlDeclaration;
84 friend class DtdParser;
85 friend class Schema::Parser;
86 friend class Schema::XmlSchemaValidator;
87 friend class XmlConvert;
88 friend class Ucs4Decoder;
89 friend class Ucs4Decoder4321;
90 friend class Ucs4Decoder1234;
91 friend class Ucs4Decoder2143;
92 friend class Ucs4Decoder3412;
93 friend class Details_XmlException;
94 friend class Xsl::XsltOld::BuilderInfo;
95 friend class Xsl::XsltOld::Compiler;
96 friend class Xsl::XsltOld::ReaderOutput;
97 friend class Xsl::XsltOld::SequentialOutput;
99
100public:
101
103 static ASPOSECPP_SHARED_API XmlCharType get_Instance();
104
105 ASPOSECPP_SHARED_API bool IsWhiteSpace(char16_t ch);
106 ASPOSECPP_SHARED_API bool IsNCNameSingleChar(char16_t ch);
107 ASPOSECPP_SHARED_API bool IsStartNCNameSingleChar(char16_t ch);
108 ASPOSECPP_SHARED_API bool IsNameSingleChar(char16_t ch);
109 ASPOSECPP_SHARED_API bool IsCharData(char16_t ch);
110 ASPOSECPP_SHARED_API bool IsPubidChar(char16_t ch);
111 ASPOSECPP_SHARED_API bool IsLetter(char16_t ch);
112 ASPOSECPP_SHARED_API bool IsNCNameCharXml4e(char16_t ch);
113 ASPOSECPP_SHARED_API bool IsStartNCNameCharXml4e(char16_t ch);
114 ASPOSECPP_SHARED_API bool IsNameCharXml4e(char16_t ch);
115 static ASPOSECPP_SHARED_API bool IsDigit(char16_t ch);
116
117 ASPOSECPP_SHARED_API XmlCharType();
119
120protected:
121
123 static const int32_t SurHighStart;
124 static const int32_t SurHighEnd;
125 static const int32_t SurLowStart;
126 static const int32_t SurLowEnd;
127 static const int32_t SurMask;
128 static const int32_t fWhitespace;
129 static const int32_t fLetter;
130 static const int32_t fNCStartNameSC;
131 static const int32_t fNCNameSC;
132 static const int32_t fCharData;
133 static const int32_t fNCNameXml4e;
134 static const int32_t fText;
135 static const int32_t fAttrValue;
136
137 bool IsTextChar(char16_t ch);
138 bool IsAttributeValueChar(char16_t ch);
139 static bool IsHighSurrogate(int32_t ch);
140 static bool IsLowSurrogate(int32_t ch);
141 static bool IsSurrogate(int32_t ch);
142 static int32_t CombineSurrogateChar(int32_t lowChar, int32_t highChar);
143 static void SplitSurrogateChar(int32_t combinedChar, char16_t& lowChar, char16_t& highChar);
144 bool IsOnlyWhitespace(const String& str);
145 int32_t IsOnlyWhitespaceWithPos(const String& str);
146 int32_t IsOnlyCharData(const String& str);
147 static bool IsOnlyDigits(const String& str, int32_t startPos, int32_t len);
148 int32_t IsPublicId(const String& str);
149
150 #ifdef ASPOSE_GET_SHARED_MEMBERS
151 ASPOSECPP_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
152 #endif
153
154 #ifdef __DBG_FOR_EACH_MEMBER
155public:
158 ASPOSECPP_SHARED_API void DBG_for_each_member(DBG::for_each_member_visitor& visitor) const override;
161 const char* DBG_class_name() const override { return "XmlCharType"; }
162 #endif
164
165private:
166
167 static const String s_PublicIdBitmap;
168
169 static ArrayPtr<uint8_t>& s_xmlCharTypeData();
170 static ArrayPtr<int16_t>& s_Indexes();
171 static ArrayPtr<IntPtr>& s_PageIndexes();
172 static uint8_t**& s_CharProperties();
173
174 uint8_t** _charProperties;
175
176 static uint8_t** InitializeCharProperties();
177
178 XmlCharType(uint8_t** charProperties);
179
180 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlCharType, CODEPORTING_ARGS(uint8_t** charProperties));
181 static bool InRange(int32_t value, int32_t start, int32_t end);
182
183};
184
185} // namespace Xml
186} // namespace System
187
188
Template that represents wrapper of exceptions that are derived from Exception class.
Definition: exception.h:118
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:51
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:125
Returns detailed information about the last exception.
Definition: xml_exception.h:82
Represents an XML Schema Definition Language (XSD) Schema validation engine. The XmlSchemaValidator c...
Definition: xml_schema_validator.h:93
For internal purposes. Do not use this class directly.
Definition: xml_char_type.h:61
Provides text manipulation methods that are used by several classes.
Definition: xml_character_data.h:36
Encodes and decodes XML names, and provides methods for converting between runtime types and XML Sche...
Definition: xml_convert.h:141
Represents the XML declaration node <?xml version='1.0'...?>.
Definition: xml_declaration.h:32
Represents a writer that provides a fast, non-cached, forward-only way of generating streams or files...
Definition: xml_text_writer.h:52
System::ExceptionWrapper< Details_XmlException > XmlException
Definition: xml_exception.h:78
@ Schema
Validate according to XML Schema definition language (XSD) schemas, including inline XML Schemas....
@ Xml
Serialize according to the XML 1.0 rules.
@ XmlDeclaration
The XML declaration (for example, <?xml version='1.0'?>). The XmlNodeType::XmlDeclaration node must b...
Definition: db_command.h:9