3#include <system/value_tuple.h>
4#include <system/idisposable.h>
5#include <system/default.h>
6#include <system/collections/iequality_comparer.h>
7#include <system/array.h>
8#include <system/memory.h>
11#include "system/text/json/json_token_type.h"
12#include "system/text/json/document/json_document_options.h"
13#include "system/text/json/document/json_property.h"
17template <
typename>
class ArraySegment;
20template <
typename>
class ReadOnlySequence;
26template <
typename>
class HashSet;
37template <
typename>
class ReadOnlySpan;
75 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
76 ASPOSECPP_SHARED_RTTI_INFO_DECL();
89 static const int32_t Size = 12;
98 static const int32_t UnknownSize = -1;
108 int32_t _sizeOrLengthUnion;
109 int32_t _numberOfRowsAndTypeUnion;
115 class MetadataDb :
public IDisposable,
public System::Details::BoxableObjectBase
120 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
121 ASPOSECPP_SHARED_RTTI_INFO_DECL();
125 ASPOSECPP_VALUE_TYPE_IMPLEMENTS_INTERFACES();
129 int32_t get_Length();
133 static JsonDocument::MetadataDb CreateRented(int32_t payloadLength,
bool convertToAlloc);
134 static JsonDocument::MetadataDb CreateLocked(int32_t payloadLength);
135 void Dispose()
override;
136 void CompleteAllocations();
137 void Append(
JsonTokenType tokenType, int32_t startLocation, int32_t length);
138 void SetLength(int32_t index, int32_t length);
139 void SetNumberOfRows(int32_t index, int32_t numberOfRows);
140 void SetHasComplexChildren(int32_t index);
141 int32_t FindIndexOfFirstUnsetSizeOrLength(
JsonTokenType lookupType);
144 JsonDocument::MetadataDb CopySegment(int32_t startIndex, int32_t endIndex);
150 #ifdef ASPOSE_GET_SHARED_MEMBERS
151 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
156 static const int32_t SizeOrLengthOffset = 4;
157 static const int32_t NumberOfRowsOffset = 8;
160 void set_Length(int32_t value);
163 bool _convertToAlloc;
168 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(MetadataDb, CODEPORTING_ARGS(
System::SharedPtr<
Array<uint8_t>> initialDb,
bool isLocked,
bool convertToAlloc));
171 void AssertValidIndex(int32_t index);
179 typedef PropertyNameSet ThisType;
182 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
183 ASPOSECPP_SHARED_RTTI_INFO_DECL();
187 class InlineRangeArray16 :
public System::Object,
public System::Details::BoxableObjectBase
189 typedef InlineRangeArray16 ThisType;
192 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
193 ASPOSECPP_SHARED_RTTI_INFO_DECL();
197 InlineRangeArray16();
204 #ifdef ASPOSE_GET_SHARED_MEMBERS
205 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
216 typedef PropertyNameComparer ThisType;
219 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
220 ASPOSECPP_SHARED_RTTI_INFO_DECL();
235 void SetCapacity(int32_t capacity);
242 #ifdef ASPOSE_GET_SHARED_MEMBERS
243 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
249 static const int32_t ArraySetThreshold = 16;
250 int32_t _arraySetCount;
252 JsonDocument::PropertyNameSet::InlineRangeArray16 _arraySet;
264 static const int32_t Size = 8;
265 int32_t SizeOrLength;
266 int32_t NumberOfRows;
268 StackRow(int32_t sizeOrLength = 0, int32_t numberOfRows = -1);
272 class StackRowStack :
public IDisposable,
public System::Details::BoxableObjectBase
274 typedef StackRowStack ThisType;
275 typedef IDisposable BaseType;
277 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
278 ASPOSECPP_SHARED_RTTI_INFO_DECL();
282 ASPOSECPP_VALUE_TYPE_IMPLEMENTS_INTERFACES();
286 StackRowStack(int32_t initialSize);
288 void Dispose()
override;
289 void Push(JsonDocument::StackRow row);
290 JsonDocument::StackRow Pop();
296 #ifdef ASPOSE_GET_SHARED_MEMBERS
297 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
333 ASPOSECPP_SHARED_API int32_t
GetEndIndex(int32_t index,
bool includeEndElement);
342 ASPOSECPP_SHARED_API
bool TryGetValue(int32_t index, int8_t& value);
343 ASPOSECPP_SHARED_API
bool TryGetValue(int32_t index, uint8_t& value);
344 ASPOSECPP_SHARED_API
bool TryGetValue(int32_t index, int16_t& value);
345 ASPOSECPP_SHARED_API
bool TryGetValue(int32_t index, uint16_t& value);
346 ASPOSECPP_SHARED_API
bool TryGetValue(int32_t index, int32_t& value);
347 ASPOSECPP_SHARED_API
bool TryGetValue(int32_t index, uint32_t& value);
348 ASPOSECPP_SHARED_API
bool TryGetValue(int32_t index, int64_t& value);
349 ASPOSECPP_SHARED_API
bool TryGetValue(int32_t index, uint64_t& value);
350 ASPOSECPP_SHARED_API
bool TryGetValue(int32_t index,
double& value);
351 ASPOSECPP_SHARED_API
bool TryGetValue(int32_t index,
float& value);
371 #ifdef ASPOSE_GET_SHARED_MEMBERS
372 ASPOSECPP_SHARED_API
void GetSharedMembers(System::Object::shared_members_type& result)
const override;
378 JsonDocument::MetadataDb _parsedData;
381 bool pr_IsDisposable;
385 static const int32_t UnseekableStreamInitialRentSize = 4096;
400 ASPOSECPP_SHARED_API
void CheckNotDisposed();
Class that represents an array data structure. Objects of this class should only be allocated using S...
Definition: array.h:296
Represents a segment of the one-dimensional array. This type should be allocated on stack and passed ...
Definition: array_segment.h:62
Interface providing means to compare two objects for equality. Objects of this class should only be a...
Definition: iequality_comparer.h:18
Represents a specific date and time value on the time continuum. This type should be allocated on sta...
Definition: date_time.h:50
Contains the date and time of day relative to Coordinated Universal Time. Objects of this class shoul...
Definition: date_time_offset.h:16
Represents a decimal number. This type should be allocated on stack and passed to functions by value ...
Definition: decimal.h:107
Represents a Globally Unique IDentifier This type should be allocated on stack and passed to function...
Definition: guid.h:34
Defines method that releases resources owned by the current object. Objects of this class should only...
Definition: idisposable.h:30
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:51
Forward to use within Span class.
Definition: span.h:415
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:126
Definition: json_document.h:71
static System::SharedPtr< JsonDocument > Parse(System::SharedPtr< IO::Stream > utf8Json, JsonDocumentOptions options=System::Default< System::Text::Json::JsonDocumentOptions >())
JsonTokenType GetJsonTokenType(int32_t index)
static System::SharedPtr< JsonDocument > Parse(ReadOnlyMemory< uint8_t > utf8Json, JsonDocumentOptions options=System::Default< System::Text::Json::JsonDocumentOptions >())
JsonElement get_RootElement()
static System::SharedPtr< JsonDocument > ParseValue(Utf8JsonReader &reader, bool allowDuplicateProperties)
bool TryGetValue(int32_t index, int16_t &value)
void WriteElementTo(int32_t index, System::SharedPtr< Utf8JsonWriter > writer)
bool TryGetValue(int32_t index, int8_t &value)
bool TryGetNamedPropertyValue(int32_t index, ReadOnlySpan< char16_t > propertyName, JsonElement &value)
JsonElement CloneElement(int32_t index)
bool ValueIsEscaped(int32_t index, bool isPropertyName)
String GetNameOfPropertyValue(int32_t index)
ReadOnlySpan< uint8_t > GetPropertyNameRaw(int32_t index)
bool TryGetValue(int32_t index, DateTime &value)
String GetPropertyRawValueAsString(int32_t valueIndex)
String GetString(int32_t index, JsonTokenType expectedType)
bool TryGetValue(int32_t index, int32_t &value)
bool TryGetValue(int32_t index, int64_t &value)
static System::SharedPtr< JsonDocument > ParseValue(String json, JsonDocumentOptions options)
String GetRawValueAsString(int32_t index)
bool TryGetValue(int32_t index, double &value)
static System::SharedPtr< JsonDocument > ParseValue(ReadOnlySpan< uint8_t > utf8Json, JsonDocumentOptions options)
static System::SharedPtr< JsonDocument > Parse(String json, JsonDocumentOptions options=System::Default< System::Text::Json::JsonDocumentOptions >())
static System::SharedPtr< JsonDocument > ParseRented(System::SharedPtr< PooledByteBufferWriter > utf8Json, JsonDocumentOptions options=System::Default< System::Text::Json::JsonDocumentOptions >())
bool TextEquals(int32_t index, ReadOnlySpan< char16_t > otherText, bool isPropertyName)
void Dispose() override
Does nothing.
void WritePropertyName(int32_t index, System::SharedPtr< Utf8JsonWriter > writer)
void WriteTo(System::SharedPtr< Utf8JsonWriter > writer)
ReadOnlyMemory< uint8_t > GetRawValue(int32_t index, bool includeQuotes)
bool TryGetValue(int32_t index, uint16_t &value)
int32_t GetArrayLength(int32_t index)
JsonElement GetArrayIndexElement(int32_t currentIndex, int32_t arrayIndex)
static bool TryParseValue(Utf8JsonReader &reader, System::SharedPtr< JsonDocument > &document, bool shouldThrow, bool useArrayPools, bool allowDuplicateProperties=true)
bool TryGetValue(int32_t index, System::SharedPtr< Array< uint8_t > > &value)
int32_t GetPropertyCount(int32_t index)
bool TryGetNamedPropertyValue(int32_t index, ReadOnlySpan< uint8_t > propertyName, JsonElement &value)
bool TryGetValue(int32_t index, uint32_t &value)
bool TryGetValue(int32_t index, uint8_t &value)
bool TryGetValue(int32_t index, float &value)
static System::SharedPtr< JsonDocument > Parse(ReadOnlyMemory< char16_t > json, JsonDocumentOptions options=System::Default< System::Text::Json::JsonDocumentOptions >())
bool TryGetValue(int32_t index, uint64_t &value)
static System::SharedPtr< JsonDocument > ParseValue(Utf8JsonReader &reader)
bool TryGetValue(int32_t index, Decimal &value)
bool TextEquals(int32_t index, ReadOnlySpan< uint8_t > otherUtf8Text, bool isPropertyName, bool shouldUnescape)
static System::SharedPtr< JsonDocument > ParseValue(ReadOnlySpan< char16_t > json, JsonDocumentOptions options)
bool TryGetValue(int32_t index, Guid &value)
static System::SharedPtr< JsonDocument > Parse(Buffers::ReadOnlySequence< uint8_t > utf8Json, JsonDocumentOptions options=System::Default< System::Text::Json::JsonDocumentOptions >())
ReadOnlyMemory< uint8_t > GetRootRawValue()
bool TryGetValue(int32_t index, DateTimeOffset &value)
static System::SharedPtr< JsonDocument > ParseValue(System::SharedPtr< IO::Stream > utf8Json, JsonDocumentOptions options)
int32_t GetEndIndex(int32_t index, bool includeEndElement)
static bool TryParseValue(Utf8JsonReader &reader, System::SharedPtr< JsonDocument > &document)
Definition: json_document_options.h:26
Definition: json_element.h:59
Definition: json_property.h:30
Definition: json_reader_options.h:26
Definition: json_serializer_helpers.h:91
Definition: json_node.h:54
Definition: pooled_byte_buffer_writer.h:32
Definition: json_document_converter.h:40
Definition: utf8_json_reader.h:78
Definition: utf8_json_writer.h:81
@ Text
Defines color adjustment information for text.
@ Stream
The type that supports reliable, two-way, connection-based byte streams without duplication of data a...
JsonTokenType
Definition: json_token_type.h:12
Definition: db_command.h:9
bool Equals(const TA &a, const TB &b)
Determines the equality of two values applying operator==() to them.
Definition: primitive_types.h:77
auto & Get(T &collection, const Index &index)
Implementation for collection[index] expressions.
Definition: index.h:98
std::enable_if< std::is_scalar< T >::value, int >::type GetHashCode(const T &obj)
Returns a hash code for the specified scalar value.
Definition: get_hash_code.h:21
Definition: json_document.h:86
DbRow(JsonTokenType jsonTokenType, int32_t location, int32_t sizeOrLength)
int32_t get_Location() const
int32_t get_SizeOrLength() const
bool get_IsSimpleValue() const
JsonTokenType get_TokenType() const
bool get_HasComplexChildren() const
bool get_IsUnknownSize() const
int32_t get_NumberOfRows() const