3#include <system/span.h>
4#include <system/idisposable.h>
5#include <system/default.h>
6#include <system/array.h>
7#include <system/memory.h>
10#include "system/text/json/json_token_type.h"
11#include "system/text/json/writer/json_writer_options.h"
12#include "system/text/json/json_bit_stack.h"
18template <
typename>
class ArrayBufferWriter;
19template <
typename>
class IBufferWriter;
20template <
typename>
class ReadOnlySequence;
39class JsonValueOfJsonNumber;
45class BooleanConverter;
47class DateTimeConverter;
48class DateTimeOffsetConverter;
49class DecimalConverter;
51template <
typename>
class EnumConverter;
62template <
typename>
class JsonConverter;
65template <
typename>
class JsonPropertyInfo;
69class Utf8JsonWriterCache;
85 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
86 ASPOSECPP_SHARED_RTTI_INFO_DECL();
117 Array =
static_cast<uint8_t
>(0x10),
118 Utf8StringSequence =
static_cast<uint8_t
>(0x20),
119 Utf16StringSequence =
static_cast<uint8_t
>(0x30),
120 Base64StringSequence =
static_cast<uint8_t
>(0x40)
125 class Inline3ByteArray :
public System::Object,
public System::Details::BoxableObjectBase
127 typedef Inline3ByteArray ThisType;
130 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
302 #ifdef ASPOSE_GET_SHARED_MEMBERS
303 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
308 static const int32_t DefaultGrowthSize = 4096;
309 static const int32_t InitialGrowthSize = 256;
317 Utf8JsonWriter::Inline3ByteArray _partialStringData;
321 uint8_t _partialStringDataLength;
322 int32_t _currentDepth;
325 int32_t _indentLength;
326 int32_t _newLineLength;
327 int32_t pr_BytesPending;
329 void set_BytesPending(int32_t value);
331 int64_t pr_BytesCommitted;
333 void set_BytesCommitted(int64_t value);
334 int32_t get_Indentation();
341 String get_DebuggerDisplay();
342 bool get_IsWritingPartialString();
344 bool get_CanWriteValue();
345 bool get_HasPartialStringData();
349 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(
Utf8JsonWriter, CODEPORTING_ARGS());
353 void CheckNotDisposed();
354 void WriteStart(uint8_t token);
355 void WriteStartMinimized(uint8_t token);
356 void WriteStartSlow(uint8_t token);
357 void ValidateStart();
358 void OnValidateStartFailed();
359 void WriteStartIndented(uint8_t token);
363 void WriteStartEscapeProperty(
ReadOnlySpan<uint8_t> utf8PropertyName, uint8_t token, int32_t firstEscapeIndexProp);
366 void WriteStartEscapeProperty(
ReadOnlySpan<char16_t> propertyName, uint8_t token, int32_t firstEscapeIndexProp);
367 void WriteEnd(uint8_t token);
368 void WriteEndMinimized(uint8_t token);
369 void WriteEndSlow(uint8_t token);
370 void ValidateEnd(uint8_t token);
371 void WriteEndIndented(uint8_t token);
374 void UpdateBitStackOnStart(uint8_t token);
375 void Grow(int32_t requiredSize);
376 void FirstCallToGetMemory(int32_t requiredSize);
377 void SetFlagToAddListSeparatorBeforeNextItem();
379 void ThrowInvalidOperationException_MismatchedObjectArray(uint8_t token);
380 void ThrowInvalidOperationException_DepthTooLarge();
423 void WriteNumberEscapeProperty(
ReadOnlySpan<char16_t> propertyName,
double value, int32_t firstEscapeIndexProp);
424 void WriteNumberEscapeProperty(
ReadOnlySpan<uint8_t> utf8PropertyName,
double value, int32_t firstEscapeIndexProp);
433 void WriteNumberEscapeProperty(
ReadOnlySpan<char16_t> propertyName,
float value, int32_t firstEscapeIndexProp);
434 void WriteNumberEscapeProperty(
ReadOnlySpan<uint8_t> utf8PropertyName,
float value, int32_t firstEscapeIndexProp);
459 void ValidateDepth();
460 void ValidateWritingProperty();
461 void ValidateWritingProperty(uint8_t token);
462 void OnValidateWritingPropertyFailed();
482 void WriteNumberEscapeProperty(
ReadOnlySpan<char16_t> propertyName, int64_t value, int32_t firstEscapeIndexProp);
483 void WriteNumberEscapeProperty(
ReadOnlySpan<uint8_t> utf8PropertyName, int64_t value, int32_t firstEscapeIndexProp);
496 void WriteStringEscapeProperty(
ReadOnlySpan<uint8_t> utf8PropertyName, int32_t firstEscapeIndexProp);
532 void WriteNumberEscapeProperty(
ReadOnlySpan<char16_t> propertyName, uint64_t value, int32_t firstEscapeIndexProp);
533 void WriteNumberEscapeProperty(
ReadOnlySpan<uint8_t> utf8PropertyName, uint64_t value, int32_t firstEscapeIndexProp);
543 void WriteStringValueMinimized(
DateTime value);
544 void WriteStringValueIndented(
DateTime value);
547 void WriteNumberValueMinimized(
Decimal value);
548 void WriteNumberValueIndented(
Decimal value);
549 void WriteNumberValueMinimized(
double value);
550 void WriteNumberValueIndented(
double value);
551 static bool TryFormatDouble(
double value,
Span<uint8_t> destination, int32_t& bytesWritten);
552 void WriteNumberValueMinimized(
float value);
553 void WriteNumberValueIndented(
float value);
554 static bool TryFormatSingle(
float value,
Span<uint8_t> destination, int32_t& bytesWritten);
557 void WriteStringValueMinimized(
Guid value);
558 void WriteStringValueIndented(
Guid value);
559 void ClearPartialStringData();
560 void ValidateWritingValue();
561 void OnValidateWritingValueFailed();
564 void ValidateNotWithinUnfinalizedString();
571 void WriteNumberValueMinimized(int64_t value);
572 void WriteNumberValueIndented(int64_t value);
585 void WriteStringSegmentEscapeValue(
ReadOnlySpan<char16_t> value, int32_t firstEscapeIndexVal,
bool isFinalSegment);
589 void WriteStringSegmentEscapeValue(
ReadOnlySpan<uint8_t> utf8Value, int32_t firstEscapeIndexVal,
bool isFinalSegment);
593 void WriteStringSegmentPrologue();
594 void WriteStringSegmentIndentedPrologue();
595 void WriteStringSegmentMinimizedPrologue();
596 void WriteStringSegmentEpilogue();
601 for (int32_t i = 0; i < srcLeft.get_Length(); i++)
603 if ((uint32_t)total >= (uint32_t)dest.get_Length())
609 dest[total++] = srcLeft[i];
612 for (int32_t i = 0; i < srcRight.get_Length(); i++)
614 if ((uint32_t)total >= (uint32_t)dest.get_Length())
620 dest[total++] = srcRight[i];
627 void WriteNumberValueMinimized(uint64_t value);
628 void WriteNumberValueIndented(uint64_t value);
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
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
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_encoded_text.h:29
Definition: json_writer_options.h:31
Definition: json_value_of_json_primitive.h:223
Definition: boolean_converter.h:38
Definition: byte_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: s_byte_converter.h:38
Definition: single_converter.h:38
Definition: u_int_16_converter.h:38
Definition: u_int_32_converter.h:38
Definition: u_int_64_converter.h:38
Definition: json_converter_of_t.h:80
Definition: json_property_info_of_t.h:69
Definition: throw_helper.h:91
Definition: utf8_json_writer_cache.h:31
Definition: utf8_json_writer.h:81
void WriteString(ReadOnlySpan< uint8_t > utf8PropertyName, DateTime value)
void WriteNumberValue(uint64_t value)
Utf8JsonWriter(System::SharedPtr< IO::Stream > utf8Json, JsonWriterOptions options=System::Default< System::Text::Json::JsonWriterOptions >())
void WriteNumber(JsonEncodedText propertyName, double value)
void WriteBase64StringValue(ReadOnlySpan< uint8_t > bytes)
void WriteBase64String(ReadOnlySpan< char16_t > propertyName, ReadOnlySpan< uint8_t > bytes)
void WriteNumber(ReadOnlySpan< char16_t > propertyName, uint32_t value)
void WriteNumberValueAsString(int64_t value)
void WriteBoolean(JsonEncodedText propertyName, bool value)
void Reset(System::SharedPtr< IO::Stream > utf8Json, JsonWriterOptions options)
void ResetAllStateForCacheReuse()
void WriteString(ReadOnlySpan< uint8_t > utf8PropertyName, ReadOnlySpan< char16_t > value)
void WriteBase64String(JsonEncodedText propertyName, ReadOnlySpan< uint8_t > bytes)
int32_t get_CurrentDepth()
void WritePropertyName(DateTimeOffset value)
void WriteStringValue(DateTime value)
void WriteNumber(JsonEncodedText propertyName, int64_t value)
void Dispose() override
Does nothing.
void WriteNull(ReadOnlySpan< uint8_t > utf8PropertyName)
void WriteNumber(JsonEncodedText propertyName, uint32_t value)
void WritePropertyName(ReadOnlySpan< uint8_t > utf8PropertyName)
void WriteNumberValue(Decimal value)
void WriteStartObject(String propertyName)
void WriteString(JsonEncodedText propertyName, JsonEncodedText value)
void WriteBoolean(String propertyName, bool value)
void WriteString(String propertyName, ReadOnlySpan< uint8_t > utf8Value)
void WritePropertyName(String propertyName)
void WritePropertyName(double value)
void WriteNumber(ReadOnlySpan< char16_t > propertyName, double value)
void WriteNumber(String propertyName, uint32_t value)
void WriteNullSection(ReadOnlySpan< uint8_t > escapedPropertyNameSection)
void WritePropertyName(int32_t value)
void WriteNumberValueAsString(Decimal value)
void WriteBase64String(ReadOnlySpan< uint8_t > utf8PropertyName, ReadOnlySpan< uint8_t > bytes)
void WriteString(ReadOnlySpan< uint8_t > utf8PropertyName, DateTimeOffset value)
void WriteStringValue(ReadOnlySpan< char16_t > value)
void WriteNumber(ReadOnlySpan< uint8_t > utf8PropertyName, double value)
void WriteNumber(String propertyName, int32_t value)
int64_t get_BytesCommitted()
void WritePropertyName(float value)
void WritePropertyName(uint64_t value)
void WriteString(ReadOnlySpan< uint8_t > utf8PropertyName, Guid value)
void WriteNumberValue(double value)
void WriteNumber(String propertyName, float value)
void WritePropertyName(uint32_t value)
void WriteStartArray(ReadOnlySpan< uint8_t > utf8PropertyName)
void WriteStringValue(String value)
void WriteNumberValue(ReadOnlySpan< uint8_t > utf8FormattedNumber)
void WriteNumber(ReadOnlySpan< char16_t > propertyName, int64_t value)
void WriteBase64String(String propertyName, ReadOnlySpan< uint8_t > bytes)
static System::SharedPtr< Utf8JsonWriter > CreateEmptyInstanceForCaching()
void WriteNumber(JsonEncodedText propertyName, int32_t value)
void WriteNumber(JsonEncodedText propertyName, uint64_t value)
void WriteString(String propertyName, ReadOnlySpan< char16_t > value)
void WriteNumber(String propertyName, double value)
void WriteNumberValue(int64_t value)
void WriteString(String propertyName, JsonEncodedText value)
void WriteNumber(ReadOnlySpan< uint8_t > utf8PropertyName, int32_t value)
void WriteString(ReadOnlySpan< char16_t > propertyName, DateTime value)
void WritePropertyName(Guid value)
void WriteNumberValue(float value)
void WriteFloatingPointConstant(double value)
void WriteNumber(String propertyName, uint64_t value)
void WriteString(ReadOnlySpan< char16_t > propertyName, Guid value)
void WriteString(ReadOnlySpan< char16_t > propertyName, String value)
void WriteNumber(ReadOnlySpan< char16_t > propertyName, ReadOnlySpan< uint8_t > utf8FormattedNumber)
void WriteStartArray(ReadOnlySpan< char16_t > propertyName)
void WriteStringValue(Guid value)
int32_t get_BytesPending()
void WriteString(JsonEncodedText propertyName, DateTimeOffset value)
void WriteRawValue(ReadOnlySpan< char16_t > json, bool skipInputValidation=false)
void WriteNumber(String propertyName, int64_t value)
void WriteNumber(ReadOnlySpan< uint8_t > utf8PropertyName, float value)
void WriteString(ReadOnlySpan< char16_t > propertyName, JsonEncodedText value)
void WritePropertyName(const char16_t *propertyName)
void WriteStringValue(DateTimeOffset value)
Utf8JsonWriter(System::SharedPtr< Buffers::IBufferWriter< uint8_t > > bufferWriter, JsonWriterOptions options=System::Default< System::Text::Json::JsonWriterOptions >())
void WriteString(String propertyName, DateTime value)
void WriteFloatingPointConstant(float value)
void Reset(System::SharedPtr< IO::Stream > utf8Json)
void WriteStringValueSegment(ReadOnlySpan< uint8_t > value, bool isFinalSegment)
void WriteNumberValueAsString(double value)
void WriteString(String propertyName, String value)
void WriteStartObject(ReadOnlySpan< char16_t > propertyName)
void WriteNumber(ReadOnlySpan< uint8_t > utf8PropertyName, uint32_t value)
void WriteNull(ReadOnlySpan< char16_t > propertyName)
void WriteStartArray(String propertyName)
void WriteNumberValueAsString(uint64_t value)
void ConfigureForCacheReuse(System::SharedPtr< Buffers::IBufferWriter< uint8_t > > bufferWriter, JsonWriterOptions options)
void WriteNumberValueAsStringUnescaped(ReadOnlySpan< uint8_t > utf8Value)
void WriteNumber(ReadOnlySpan< uint8_t > utf8PropertyName, uint64_t value)
void WriteNumber(ReadOnlySpan< char16_t > propertyName, Decimal value)
JsonTokenType get_TokenType()
void WriteStartObject(JsonEncodedText propertyName)
void WriteNumber(JsonEncodedText propertyName, float value)
void WriteNumberValue(int32_t value)
void WriteStartArray(JsonEncodedText propertyName)
void WriteString(JsonEncodedText propertyName, Guid value)
void WriteNumber(ReadOnlySpan< char16_t > propertyName, uint64_t value)
void WritePropertyNameSection(ReadOnlySpan< uint8_t > escapedPropertyNameSection)
void WritePropertyName(bool value)
void WriteBase64StringSegment(ReadOnlySpan< uint8_t > value, bool isFinalSegment)
void WriteNumber(ReadOnlySpan< char16_t > propertyName, int32_t value)
void WriteString(JsonEncodedText propertyName, String value)
void WriteStringValue(ReadOnlySpan< uint8_t > utf8Value)
JsonWriterOptions get_Options()
void WriteString(ReadOnlySpan< char16_t > propertyName, ReadOnlySpan< uint8_t > utf8Value)
void WriteBoolean(ReadOnlySpan< char16_t > propertyName, bool value)
void WriteStringValueSegment(ReadOnlySpan< char16_t > value, bool isFinalSegment)
void WriteNumberValueAsString(float value)
void WritePropertyName(JsonEncodedText propertyName)
void WriteNumberValue(uint32_t value)
void WriteString(JsonEncodedText propertyName, ReadOnlySpan< char16_t > value)
void WriteNumber(ReadOnlySpan< uint8_t > utf8PropertyName, Decimal value)
void WritePropertyName(Decimal value)
void WriteBoolean(ReadOnlySpan< uint8_t > utf8PropertyName, bool value)
void WriteNumber(ReadOnlySpan< uint8_t > utf8PropertyName, ReadOnlySpan< uint8_t > utf8FormattedNumber)
void WriteNumber(String propertyName, Decimal value)
void WriteString(JsonEncodedText propertyName, DateTime value)
void WriteNumber(ReadOnlySpan< uint8_t > utf8PropertyName, int64_t value)
void WriteString(ReadOnlySpan< char16_t > propertyName, ReadOnlySpan< char16_t > value)
void WritePropertyName(ReadOnlySpan< char16_t > propertyName)
void WriteRawValue(String json, bool skipInputValidation=false)
void WriteRawValue(Buffers::ReadOnlySequence< uint8_t > utf8Json, bool skipInputValidation=false)
void WriteString(ReadOnlySpan< uint8_t > utf8PropertyName, String value)
void WriteString(String propertyName, DateTimeOffset value)
void WriteNumber(JsonEncodedText propertyName, ReadOnlySpan< uint8_t > utf8FormattedNumber)
void WriteStringValue(JsonEncodedText value)
void WriteNull(String propertyName)
void WriteString(ReadOnlySpan< char16_t > propertyName, DateTimeOffset value)
void WriteString(String propertyName, Guid value)
void WriteStartObject(ReadOnlySpan< uint8_t > utf8PropertyName)
void WriteString(JsonEncodedText propertyName, ReadOnlySpan< uint8_t > utf8Value)
void WriteBooleanValue(bool value)
void WritePropertyName(DateTime value)
void WriteNull(JsonEncodedText propertyName)
void Reset(System::SharedPtr< Buffers::IBufferWriter< uint8_t > > bufferWriter, JsonWriterOptions options)
void WriteNumber(ReadOnlySpan< char16_t > propertyName, float value)
EnclosingContainerType
Definition: utf8_json_writer.h:114
void Reset(System::SharedPtr< Buffers::IBufferWriter< uint8_t > > bufferWriter)
void WritePropertyName(int64_t value)
void WriteString(ReadOnlySpan< uint8_t > utf8PropertyName, ReadOnlySpan< uint8_t > utf8Value)
void WriteString(ReadOnlySpan< uint8_t > utf8PropertyName, JsonEncodedText value)
void WriteNumber(JsonEncodedText propertyName, Decimal value)
void WriteRawValue(ReadOnlySpan< uint8_t > utf8Json, bool skipInputValidation=false)
@ 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
ExceptionResource
Definition: throw_helper.h:273
Definition: db_command.h:9