CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
fwd.h
1
2#ifndef __fwd_h__
3#define __fwd_h__
4
5#include <cstddef>
6#include <cstdint>
7#include <type_traits>
8#include <locale>
9#include <codecvt>
10#include <string>
11
13template<class T>
14struct EnumMetaInfo; // declared out of System namespace
15
16// Forward declarations
17namespace System {
18
19 class IFormatProvider;
20
21 template<class T>
22 class SmartPtr;
23
24 class Index;
25 class Range;
26
27 namespace Text {
28 class DecoderFallback;
31 class EncoderFallback;
33 class Encoder;
34 class Decoder;
35 class Encoding;
36 class EncodingInfo;
39 }
40
41 namespace IO {
42 class Stream;
43 class FileStream;
44 class MemoryStream;
45 class StreamReader;
46 class StreamWriter;
47 class FileInfo;
48 class FileSystemInfo;
49 class DirectoryInfo;
50 }
51
52
53 namespace Drawing {
54 class SizeF;
55 class PointF;
56 class Size;
57 class Point;
58 class Rectangle;
59 class RectangleF;
60 }
61
62 namespace Globalization
63 {
64 class CultureInfo;
65 }
66
67 namespace Threading {
69 namespace Tasks {
70 class Task;
71 template <typename T>
72 class ResultTask;
73 }} // namespace Threading::Tasks
74
75// Pointer typedefs
100
111
118
122template<typename T>
124
126template <typename ReturnT, typename... ArgsT>
127using FunctionPtr = ReturnT(*)(ArgsT...);
128}
129
130// Common typedefs
131
133typedef char16_t char_t;
134
136struct IntPtr_helper
137 : std::enable_if<sizeof(void*) == sizeof(uint32_t), uint32_t>
138 , std::enable_if<sizeof(void*) == sizeof(uint64_t), uint64_t>
139{};
141typedef IntPtr_helper::type IntPtr;
142static_assert(sizeof(void*) == sizeof(IntPtr), "Failed to set up IntPtr type");
144const IntPtr IntPtrZero = 0;
145
147#define ASPOSE_T(x) u##x
148
150#define __WIDEN2(quote) L##quote
152#define __WIDEN(quote) __WIDEN2(quote)
153
155#define __QUOTE1(x) #x
157#define __QUOTE2(x) __QUOTE1(x)
158
159#if defined(__GNUC__) || defined (__clang__)
160 // under gcc __PRETTY_FUNCTION__ is a variable, so it is impossible to widen :(
162 #define ASPOSE_CURRENT_FUNCTION System::Details::Utf8To16String(__PRETTY_FUNCTION__).c_str()
164 #define ASPOSE_CURRENT_FUNCTION_LINE System::Details::Utf8To16String((std::string(__PRETTY_FUNCTION__) + ":" + std::string(__QUOTE2(__LINE__))).c_str()).c_str()
165#elif defined(_MSC_VER)
167 #define ASPOSE_CURRENT_FUNCTION reinterpret_cast<const char16_t*>(__WIDEN(__FUNCSIG__))
168 #define ASPOSE_CURRENT_FUNCTION_LINE reinterpret_cast<const char16_t*>(__WIDEN(__FUNCSIG__ ":" __QUOTE2(__LINE__)))
169#else
171 #define ASPOSE_CURRENT_FUNCTION u""
173 #pragma message("ASPOSE_CURRENT_FUNCTION is undefined!")
174#endif
175
176#endif // __fwd_h__
Collection of culture-specific values and algorithms. Setter operations are only enabled on non-read-...
Definition: culture_info.h:32
Represents a file system path, a directory referred to by this path and provides instance methods for...
Definition: directory_info.h:19
Represents a path to a file and a file referred to by this path and provides methods for manipulating...
Definition: file_info.h:14
Represents a file stream supporting synchronous and asynchronous read and write operations....
Definition: file_stream.h:24
The base class for FileInfo and DirectoryInfo. Objects of this class should only be allocated using S...
Definition: file_system_info.h:31
Represents a stream that reads from and writes to memory. Objects of this class should only be alloca...
Definition: memory_stream.h:19
A base class for a variety of stream implementations. Objects of this class should only be allocated ...
Definition: stream.h:26
Represents a reader that reads characters from a byte stream. Objects of this class should only be al...
Definition: stream_reader.h:22
Represents a writer that writes characters to a byte stream. Objects of this class should only be all...
Definition: stream_writer.h:18
Provides buffer for fallback implementation. Objects of this class should only be allocated using Sys...
Definition: decoder_fallback_buffer.h:15
Provides fallback API to handle decoding error. Objects of this class should only be allocated using ...
Definition: decoder_fallback.h:14
Encapsulates decoding byte sequence into character sequence. Objects of this class should only be all...
Definition: decoder.h:19
Provides fallback strategy of replacing erroneous symbol with a stub. Objects of this class should on...
Definition: decoder_replacement_fallback.h:19
Provides buffer for fallback implementation. Objects of this class should only be allocated using Sys...
Definition: encoder_fallback_buffer.h:14
Provides fallback API to handle encoding error. Objects of this class should only be allocated using ...
Definition: encoder_fallback.h:15
Encapsulates encoding character sequence into byte sequence. Objects of this class should only be all...
Definition: encoder.h:18
Buffer for replacing encoding fallback strategy. Objects of this class should only be allocated using...
Definition: encoder_replacement_fallback_buffer.h:23
Provides fallback strategy of replacing erroneous symbol with a stub. Objects of this class should on...
Definition: encoder_replacement_fallback.h:18
Encoding services.
Definition: encoding.h:71
Brief info on encoding. Objects of this class should only be allocated using System::MakeObject() fun...
Definition: encoding.h:34
Propagates notification that operations should be canceled. This class provides a mechanism for coope...
Definition: cancellation_token.h:43
A Task specialization that returns a result value upon completion.
Definition: result_task.h:24
Represents an asynchronous operation that can be awaited and composed with other tasks.
Definition: task.h:30
@ Range
The 'Range' header.
Definition: db_command.h:9
System::SmartPtr< System::IO::FileStream > FileStreamPtr
An alias for a smart pointer that points to an instance of System::IO::FileStream class.
Definition: fwd.h:104
System::SmartPtr< System::IFormatProvider > IFormatProviderPtr
An alias for a smart pointer that points to an instance of System::IFormatProvider class.
Definition: fwd.h:77
System::SmartPtr< System::Text::EncoderFallback > EncoderFallbackPtr
An alias for a smart pointer that points to an instance of System::Text::EncoderFallback class.
Definition: fwd.h:85
System::SmartPtr< System::IO::DirectoryInfo > DirectoryInfoPtr
An alias for a smart pointer that points to an instance of System::IO::DirectoryInfo class.
Definition: fwd.h:117
System::SmartPtr< System::Text::Decoder > DecoderPtr
An alias for a smart pointer that points to an instance of System::Text::Decoder class.
Definition: fwd.h:91
System::SmartPtr< System::Text::EncoderReplacementFallbackBuffer > EncoderReplacementFallbackBufferPtr
An alias for a smart pointer that points to an instance of System::Text::EncoderReplacementFallbackBu...
Definition: fwd.h:93
System::SmartPtr< System::IO::StreamWriter > StreamWriterPtr
An alias for a smart pointer that points to an instance of System::IO::StreamWriter class.
Definition: fwd.h:110
System::SmartPtr< System::IO::MemoryStream > MemoryStreamPtr
An alias for a smart pointer that points to an instance of System::IO::MemoryStream class.
Definition: fwd.h:106
System::SmartPtr< System::IO::StreamReader > StreamReaderPtr
An alias for a smart pointer that points to an instance of System::IO::StreamReader class.
Definition: fwd.h:108
System::SmartPtr< System::Text::Encoder > EncoderPtr
An alias for a smart pointer that points to an instance of System::Text::Encoder class.
Definition: fwd.h:89
System::SmartPtr< System::Text::Encoding > EncodingPtr
An alias for a smart pointer that points to an instance of System::Text::Encoding class.
Definition: fwd.h:97
System::SmartPtr< System::Text::EncodingInfo > EncodingInfoPtr
An alias for a smart pointer that points to an instance of System::Text::EncodingInfo class.
Definition: fwd.h:99
System::SmartPtr< System::Text::DecoderFallbackBuffer > DecoderFallbackBufferPtr
An alias for a smart pointer that points to an instance of System::Text::DecoderFallbackBuffer class.
Definition: fwd.h:81
System::SmartPtr< System::IO::Stream > StreamPtr
An alias for a smart pointer that points to an instance of System::IO::Stream class.
Definition: fwd.h:102
System::SmartPtr< System::Text::EncoderFallbackBuffer > EncoderFallbackBufferPtr
An alias for a smart pointer that points to an instance of System::Text::EncoderFallbackBuffer class.
Definition: fwd.h:87
System::SmartPtr< System::IO::FileSystemInfo > FileSystemInfoPtr
An alias for a smart pointer that points to an instance of System::IO::FileSystemInfo class.
Definition: fwd.h:115
ReturnT(*)(ArgsT...) FunctionPtr
An alias for function type with default calling convention.
Definition: fwd.h:127
System::SmartPtr< System::Threading::Tasks::Task > TaskPtr
An alias for a smart pointer that points to an instance of System::Threading::Tasks::Task class.
Definition: fwd.h:120
System::SmartPtr< System::Text::EncoderReplacementFallback > EncoderReplacementFallbackPtr
An alias for a smart pointer that points to an instance of System::Text::EncoderReplacementFallback c...
Definition: fwd.h:95
System::SmartPtr< System::IO::FileInfo > FileInfoPtr
An alias for a smart pointer that points to an instance of System::IO::FileInfo class.
Definition: fwd.h:113
System::SmartPtr< System::Text::DecoderReplacementFallback > DecoderReplacementFallbackPtr
An alias for a smart pointer that points to an instance of System::Text::DecoderReplacementFallback c...
Definition: fwd.h:83
System::SmartPtr< System::Text::DecoderFallback > DecoderFallbackPtr
An alias for a smart pointer that points to an instance of System::Text::DecoderFallback class.
Definition: fwd.h:79