3#include <system/type_info.h>
4#include <system/object_ext.h>
5#include <system/nullable.h>
6#include <system/guid.h>
7#include <system/diagnostics/debug.h>
8#include <system/details/pointer_collection_helpers.h>
9#include <system/details/patterns.h>
10#include <system/default.h>
11#include <system/decimal.h>
12#include <system/date_time_offset.h>
13#include <system/date_time.h>
16#include "system/text/json/document/json_element.h"
17#include "system/text/json/nodes/json_node_options.h"
18#include "system/text/json/nodes/json_value_of_t.h"
19#include "system/text/json/throw_helper.h"
20#include "system/text/json/document/json_value_kind.h"
28class JsonSerializerOptions;
51 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
62 template<
typename TypeToConvert>
66 if (!TryGetValue<TypeToConvert>(
value))
74 template<
typename TypeToConvert>
78 const System::TypeInfo& typeInfo = System::ObjectExt::GetType<TypeToConvert>();
80 TypeToConvert element;
81 if (System::Is<TypeToConvert>(
Value, element))
95 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result));
102 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result2));
109 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result3));
116 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result4));
123 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result5));
130 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result6));
137 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result7));
144 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result8));
151 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result9));
158 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result10));
165 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result11));
175 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result));
182 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result12));
189 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result13));
196 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result14));
204 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(result[0]));
214 value = System::ExplicitCast<TypeToConvert>(System::ExplicitCast<System::Object>(
Value.
GetBoolean()));
222 value = System::Default<TypeToConvert>();
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
Forward declaration.
Definition: nullable.h:75
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:126
int get_Length() const
Gets string length.
Definition: json_element.h:59
bool TryGetSingle(float &value)
bool TryGetInt32(int32_t &value)
bool TryGetInt64(int64_t &value)
bool TryGetUInt16(uint16_t &value)
JsonValueKind get_ValueKind()
bool TryGetUInt64(uint64_t &value)
bool TryGetDouble(double &value)
bool TryGetGuid(Guid &value)
bool TryGetInt16(int16_t &value)
bool TryGetSByte(int8_t &value)
bool TryGetDateTime(DateTime &value)
bool TryGetByte(uint8_t &value)
bool TryGetDateTimeOffset(DateTimeOffset &value)
bool TryGetDecimal(Decimal &value)
bool TryGetUInt32(uint32_t &value)
Definition: json_node.h:54
Definition: json_value_of_t.h:53
JsonElement Value
Definition: json_value_of_t.h:114
Definition: json_value_of_element.h:47
bool DeepEqualsCore(System::SharedPtr< JsonNode > otherNode) override
bool TryGetValue(TypeToConvert &value)
Definition: json_value_of_element.h:75
void SetTemplateWeakPtr(uint32_t argument) override
Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containe...
virtual ~JsonValueOfElement()
System::SharedPtr< JsonNode > DeepCloneCore() override
JsonValueOfElement(JsonElement value, Nullable< JsonNodeOptions > options)
Nullable< JsonElement > get_UnderlyingElement() override
void WriteTo(System::SharedPtr< Utf8JsonWriter > writer, System::SharedPtr< JsonSerializerOptions > options=nullptr) override
TypeToConvert GetValue()
Definition: json_value_of_element.h:63
static void ThrowInvalidOperationException_NodeUnableToConvertElement(JsonValueKind valueKind, const TypeInfo &destinationType)
Represents a particular type and provides information about it.
Definition: type_info.h:109
bool Equals(const TypeInfo &other) const
Definition: type_info.h:244
@ Text
Defines color adjustment information for text.
JsonValueKind
Definition: json_value_kind.h:12
Definition: db_command.h:9