CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
formatter_converter.h
1
2#pragma once
3
4#include <system/type_info.h>
5#include <system/type_code.h>
6#include <system/string.h>
7#include <system/shared_ptr.h>
8#include <system/object.h>
9#include <system/decimal.h>
10#include <system/date_time.h>
11#include <cstdint>
12
13#include "i_formatter_converter.h"
14
15namespace System {
16
17namespace Runtime {
18
19namespace Serialization {
20
23{
28
30 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
32 RTTI_INFO(ThisType, ThisTypeBaseTypesInfo);
33
34public:
35
40 ASPOSECPP_SHARED_API System::SharedPtr<Object> Convert(System::SharedPtr<Object> value, const TypeInfo& type) override;
45 ASPOSECPP_SHARED_API System::SharedPtr<Object> Convert(System::SharedPtr<Object> value, TypeCode typeCode) override;
49 ASPOSECPP_SHARED_API bool ToBoolean(System::SharedPtr<Object> value) override;
53 ASPOSECPP_SHARED_API uint8_t ToByte(System::SharedPtr<Object> value) override;
57 ASPOSECPP_SHARED_API char16_t ToChar(System::SharedPtr<Object> value) override;
61 ASPOSECPP_SHARED_API DateTime ToDateTime(System::SharedPtr<Object> value) override;
65 ASPOSECPP_SHARED_API Decimal ToDecimal(System::SharedPtr<Object> value) override;
69 ASPOSECPP_SHARED_API double ToDouble(System::SharedPtr<Object> value) override;
73 ASPOSECPP_SHARED_API int16_t ToInt16(System::SharedPtr<Object> value) override;
77 ASPOSECPP_SHARED_API int32_t ToInt32(System::SharedPtr<Object> value) override;
81 ASPOSECPP_SHARED_API int64_t ToInt64(System::SharedPtr<Object> value) override;
85 ASPOSECPP_SHARED_API int8_t ToSByte(System::SharedPtr<Object> value) override;
89 ASPOSECPP_SHARED_API float ToSingle(System::SharedPtr<Object> value) override;
93 ASPOSECPP_SHARED_API String ToString(System::SharedPtr<Object> value) override;
97 ASPOSECPP_SHARED_API uint16_t ToUInt16(System::SharedPtr<Object> value) override;
101 ASPOSECPP_SHARED_API uint32_t ToUInt32(System::SharedPtr<Object> value) override;
105 ASPOSECPP_SHARED_API uint64_t ToUInt64(System::SharedPtr<Object> value) override;
106
107};
108
109} // namespace Serialization
110} // namespace Runtime
111} // namespace System
112
Represents a specific date and time value on the time continuum. This type should be allocated on sta...
Definition: date_time.h:50
Represents a decimal number. This type should be allocated on stack and passed to functions by value ...
Definition: decimal.h:107
Represents a base implementation of the System::Runtime::Serialization::IFormatterConverter interface...
Definition: formatter_converter.h:23
int8_t ToSByte(System::SharedPtr< Object > value) override
Converts a value to a int8_t.
float ToSingle(System::SharedPtr< Object > value) override
Converts a value to a float.
DateTime ToDateTime(System::SharedPtr< Object > value) override
Converts a value to a DateTime.
int64_t ToInt64(System::SharedPtr< Object > value) override
Converts a value to a int64_t.
int16_t ToInt16(System::SharedPtr< Object > value) override
Converts a value to a int16_t.
uint8_t ToByte(System::SharedPtr< Object > value) override
Converts a value to a uint8_t.
System::SharedPtr< Object > Convert(System::SharedPtr< Object > value, TypeCode typeCode) override
Converts a value to the given System::TypeCode.
System::SharedPtr< Object > Convert(System::SharedPtr< Object > value, const TypeInfo &type) override
Converts a value to the given System::TypeInfo.
String ToString(System::SharedPtr< Object > value) override
Converts a value to a String.
uint32_t ToUInt32(System::SharedPtr< Object > value) override
Converts a value to a uint32_t.
uint16_t ToUInt16(System::SharedPtr< Object > value) override
Converts a value to a uint16_t.
uint64_t ToUInt64(System::SharedPtr< Object > value) override
Converts a value to a uint64_t.
Decimal ToDecimal(System::SharedPtr< Object > value) override
Converts a value to a Decimal.
double ToDouble(System::SharedPtr< Object > value) override
Converts a value to a double.
char16_t ToChar(System::SharedPtr< Object > value) override
Converts a value to a char16_t.
int32_t ToInt32(System::SharedPtr< Object > value) override
Converts a value to a int32_t.
bool ToBoolean(System::SharedPtr< Object > value) override
Converts a value to a bool.
Provides the connection between an instance of System::Runtime::Serialization::SerializationInfo and ...
Definition: i_formatter_converter.h:22
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:122
Represents a particular type and provides information about it.
Definition: type_info.h:109
Definition: db_command.h:9
TypeCode
Represents the type of an object.
Definition: type_code.h:19