3#include <system/span.h>
4#include <system/exceptions.h>
5#include <system/default.h>
6#include <system/array.h>
7#include <system/sequence_position.h>
8#include <system/buffers/read_only_sequence.h>
11#include "system/text/json/reader/json_reader_options.h"
12#include "system/text/json/json_bit_stack.h"
13#include "system/sequence_position.h"
21template <
typename>
class Span;
37class JsonValueOfJsonPrimitive;
45class DateTimeConverter;
46class DateTimeOffsetConverter;
47class DecimalConverter;
49template <
typename>
class EnumConverter;
54template <
typename>
class ObjectDefaultConverter;
55template <
typename>
class ObjectWithParameterizedConstructorConverter;
58class TimeSpanConverter;
62class VersionConverter;
64template <
typename,
typename>
class JsonCollectionConverter;
65template <
typename>
class JsonConverter;
82 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
83 ASPOSECPP_SHARED_RTTI_INFO_DECL();
114 class PartialStateForRollback :
public System::Object,
public System::Details::BoxableObjectBase
116 typedef PartialStateForRollback
ThisType;
119 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
124 int64_t _prevTotalConsumed;
125 int64_t _prevBytePositionInLine;
126 int32_t _prevConsumed;
129 PartialStateForRollback(int64_t totalConsumed, int64_t bytePositionInLine, int32_t consumed,
SequencePosition currentPosition);
133 PartialStateForRollback();
137 #ifdef ASPOSE_GET_SHARED_MEMBERS
138 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
160 ASPOSECPP_SHARED_API
bool Read();
161 ASPOSECPP_SHARED_API
void Skip();
247 #ifdef ASPOSE_GET_SHARED_MEMBERS
248 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
255 bool _isInputSequence;
257 int64_t _bytePositionInLine;
260 bool _isNotPrimitive;
265 int64_t _totalConsumed;
267 bool _isMultiSegment;
268 bool _trailingCommaBeforeComment;
273 bool get_IsLastSpan();
279 int64_t pr_TokenStartIndex;
281 void set_TokenStartIndex(int64_t value);
283 bool pr_HasValueSequence;
285 void set_HasValueSequence(
bool value);
287 bool pr_ValueIsEscaped;
289 void set_ValueIsEscaped(
bool value);
294 String get_DebuggerDisplay();
295 String get_DebugTokenType();
303 bool MatchNotPossible(int32_t charTextLength);
304 bool MatchNotPossibleSequence(int32_t charTextLength);
309 void UpdateBitStackOnEndToken();
310 bool ReadSingleSegment();
313 bool ReadFirstToken(uint8_t first);
314 void SkipWhiteSpace();
315 bool ConsumeValue(uint8_t marker);
319 bool ConsumeNumber();
320 bool ConsumePropertyName();
321 bool ConsumeString();
330 bool ConsumeNextTokenOrRollback(uint8_t marker);
333 bool SkipAllComments(uint8_t& marker);
341 bool ConsumeComment();
345 bool ReadMultiSegment();
346 bool ValidateStateAtEndOfData();
347 bool HasMoreDataMultiSegment();
350 bool ReadFirstTokenMultiSegment(uint8_t first);
351 void SkipWhiteSpaceMultiSegment();
352 bool ConsumeValueMultiSegment(uint8_t marker);
357 bool ConsumeNumberMultiSegment();
358 bool ConsumePropertyNameMultiSegment();
359 bool ConsumeStringMultiSegment();
360 bool ConsumeStringNextSegment();
362 void RollBackState(
const Utf8JsonReader::PartialStateForRollback& state,
bool isError =
false);
369 bool ConsumeNextTokenOrRollbackMultiSegment(uint8_t marker);
372 bool SkipAllCommentsMultiSegment(uint8_t& marker);
374 ConsumeTokenResult ConsumeNextTokenUntilAfterAllCommentsAreSkippedMultiSegment(uint8_t marker);
375 bool SkipOrConsumeCommentMultiSegmentWithRollback();
376 bool SkipCommentMultiSegment(int32_t& tailBytesToIgnore);
378 int32_t FindLineSeparatorMultiSegment(
ReadOnlySpan<uint8_t> localBuffer, int32_t& dangerousLineSeparatorBytesConsumed);
379 void ThrowOnDangerousLineSeparatorMultiSegment(
ReadOnlySpan<uint8_t> localBuffer, int32_t& dangerousLineSeparatorBytesConsumed);
381 Utf8JsonReader::PartialStateForRollback CaptureState();
382 bool TryCopyEscapedString(
Span<uint8_t> destination, int32_t& bytesWritten);
Class that represents an array data structure. Objects of this class should only be allocated using S...
Definition: array.h:296
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
Template that represents wrapper of exceptions that are derived from Exception class.
Definition: exception.h:118
Represents a Globally Unique IDentifier This type should be allocated on stack and passed to function...
Definition: guid.h:34
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:51
Represents the position of an element in a sequence. It wraps a reference to a segment object (usuall...
Definition: sequence_position.h:17
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Represents a contiguous region of arbitrary memory similar to C++20's std::span.
Definition: span.h:375
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:126
Definition: json_bit_stack.h:13
Definition: json_document.h:71
Definition: json_helpers.h:72
Definition: json_reader_options.h:26
Definition: json_reader_state.h:31
Definition: json_serializer_helpers.h:91
Definition: json_value_of_json_primitive.h:53
Definition: byte_converter.h:38
Definition: char_converter.h:38
Definition: date_time_converter.h:39
Definition: date_time_offset_converter.h:39
Definition: decimal_converter.h:39
Definition: double_converter.h:38
Definition: enum_converter.h:75
Definition: guid_converter.h:39
Definition: int_16_converter.h:38
Definition: int_32_converter.h:38
Definition: int_64_converter.h:38
Definition: object_default_converter.h:64
Definition: object_with_parameterized_constructor_converter.h:64
Definition: s_byte_converter.h:38
Definition: single_converter.h:38
Definition: time_span_converter.h:39
Definition: u_int_16_converter.h:38
Definition: u_int_32_converter.h:38
Definition: u_int_64_converter.h:38
Definition: version_converter.h:39
Definition: json_collection_converter.h:43
Definition: json_converter_of_t.h:80
Definition: utf8_json_reader.h:78
uint8_t GetByteWithQuotes()
bool TryGetDateTime(DateTime &value)
bool TryGetInt32(int32_t &value)
int32_t CopyValue(Span< uint8_t > utf8Destination)
int32_t GetInt32WithQuotes()
float GetSingleWithQuotes()
int64_t get_BytesConsumed()
int16_t GetInt16WithQuotes()
SequencePosition get_Position()
bool TryGetDouble(double &value)
bool ValueTextEquals(ReadOnlySpan< char16_t > text)
bool TryGetUInt32(uint32_t &value)
static bool TryGetUInt32Core(uint32_t &value, ReadOnlySpan< uint8_t > span)
bool TryGetUInt16(uint16_t &value)
bool ValueTextEquals(ReadOnlySpan< uint8_t > utf8Text)
bool TryGetDateTimeOffset(DateTimeOffset &value)
Utf8JsonReader(Buffers::ReadOnlySequence< uint8_t > jsonData, bool isFinalBlock, JsonReaderState state)
bool TryGetSingle(float &value)
static bool TryGetUInt16Core(uint16_t &value, ReadOnlySpan< uint8_t > span)
uint32_t GetUInt32WithQuotes()
DateTimeOffset GetDateTimeOffsetNoValidation()
ReadOnlySpan< uint8_t > get_OriginalSpan()
bool TryGetGuidCore(Guid &value)
bool TryGetByte(uint8_t &value)
bool get_HasValueSequence()
static bool TryGetSByteCore(int8_t &value, ReadOnlySpan< uint8_t > span)
int64_t GetInt64WithQuotes()
JsonReaderState get_CurrentState()
ReadOnlySpan< uint8_t > get_ValueSpan()
bool TryGetSByte(int8_t &value)
int8_t GetSByteWithQuotes()
double GetDoubleFloatingPointConstant()
bool TryGetDateTimeOffsetCore(DateTimeOffset &value)
static bool TryGetByteCore(uint8_t &value, ReadOnlySpan< uint8_t > span)
DateTime GetDateTimeNoValidation()
Buffers::ReadOnlySequence< uint8_t > get_OriginalSequence()
bool TryGetBytesFromBase64(System::SharedPtr< Array< uint8_t > > &value)
bool get_ValueIsEscaped()
bool TryGetGuid(Guid &value)
bool get_AllowMultipleValues()
JsonTokenType get_TokenType()
bool ValueTextEquals(String text)
int32_t get_ValueLength()
bool TryGetInt16(int16_t &value)
static bool TryGetInt16Core(int16_t &value, ReadOnlySpan< uint8_t > span)
int32_t CopyValue(Span< char16_t > destination)
int32_t CopyString(Span< uint8_t > utf8Destination)
double GetDoubleWithQuotes()
uint64_t GetUInt64WithQuotes()
float GetSingleFloatingPointConstant()
Guid GetGuidNoValidation()
static bool TryGetDecimalCore(Decimal &value, ReadOnlySpan< uint8_t > span)
Utf8JsonReader(Buffers::ReadOnlySequence< uint8_t > jsonData, JsonReaderOptions options=System::Default< System::Text::Json::JsonReaderOptions >())
static bool TryGetInt32Core(int32_t &value, ReadOnlySpan< uint8_t > span)
System::SharedPtr< Array< uint8_t > > GetBytesFromBase64()
int64_t get_TokenStartIndex()
Utf8JsonReader(ReadOnlySpan< uint8_t > jsonData, bool isFinalBlock, JsonReaderState state)
Buffers::ReadOnlySequence< uint8_t > get_ValueSequence()
bool TrySkipPartial(int32_t targetDepth)
bool TryGetUInt64(uint64_t &value)
Utf8JsonReader(ReadOnlySpan< uint8_t > jsonData, JsonReaderOptions options=System::Default< System::Text::Json::JsonReaderOptions >())
bool TryGetDateTimeCore(DateTime &value)
static bool TryGetInt64Core(int64_t &value, ReadOnlySpan< uint8_t > span)
uint16_t GetUInt16WithQuotes()
Decimal GetDecimalWithQuotes()
int32_t get_CurrentDepth()
bool TryGetInt64(int64_t &value)
DateTimeOffset GetDateTimeOffset()
static bool TryGetUInt64Core(uint64_t &value, ReadOnlySpan< uint8_t > span)
bool TryGetDecimal(Decimal &value)
int32_t CopyString(Span< char16_t > destination)
@ Text
Defines color adjustment information for text.
System::ExceptionWrapper< Details_JsonException > JsonException
Definition: json_exception.h:39
ConsumeTokenResult
Definition: consume_token_result.h:12
JsonTokenType
Definition: json_token_type.h:12
ExceptionResource
Definition: throw_helper.h:273
ConsumeNumberResult
Definition: consume_number_result.h:12
Definition: db_command.h:9