d2c_system

Top  Previous  Next

Pretranslated C++ code > Delphi RTL/VCL > C++ code for other compilers > d2c_system

d2c_system is the most important of the Delphi2Cpp helper files, because it contains routines, which simulate intrinsic Delphi functions.

 

 

#define MAXIDX(x) ...

#define ARRAYHIGH(arr) ...

#define SLICE(a, n) ...

#define ObjectIs(xObj, xIs) ...

#define INTFOBJECT_IMPL_IUNKNOWN(BASE) ...

 

 

extern int Argc;

extern PPChar Argv;

extern HINSTANCE HInstance;

 

const double PI = 3.141592653589793238463; // float 3.14159265358979f;

 

 

void FillChar(void* Dest, NativeInt Count, AnsiChar Value);

void FillChar(String& X, int Count, wchar_t Value );

void FillChar(std::string& X, int Count, char Value);

 

 

template <class T> std::vector<T> Slice(const T* arr, int n) ...

 

void Move(const wchar_t* Source, String& Dest, unsigned int Count);

 

WORD swap(WORD X);

int swap(int X);

unsigned int swap(unsigned int X);

int64_t swap(int64_t X);

 

template <class T> T Dec(T& xT) ...

template <class T> T Dec(T& xT, int xi) ...

bool Inc(bool& b);

template <class T> T Inc(T& xT) ...

template <class T> T Inc(T& xT, int xi) ...

template <class T> unsigned char Hi(const T& xt) ...

template <class T> unsigned char Lo(const T& xt) ...

template <class T> bool Odd(const T xT) ...

 

template <class T> T AtomicDecrement(std::atomic<T>& Target) ...

template <class T> T AtomicDecrement(std::atomic<T>& Target, T Value) ...

template <class T> T AtomicIncrement(std::atomic<T>& Target) ...

template <class T> T AtomicIncrement(std::atomic<T>& Target, T Value) ...

template <class T> T AtomicExchange(std::atomic<T>& Target, T Value) ...

template <class T> T AtomicCmpExchange(std::atomic<T>& Target, T NewValue, T Comparand) ...

template <class T> T AtomicCmpExchange(std::atomic<T>& Target, T NewValue, T Comparand, bool& Succeeded) ...

 

template <class T, class C> void CastDec(T& xT, C xC) ...

template <class T, class C, class I> void CastDec(T& xT, C xC, I xI) ...

template <class T, class C> void CastDec(T*& xpT, C* xpC) ...

template <class T, class C, class I> void CastDec(T*& xpT, C* xpC, I xI) ...

template <class T, class C, class I> void CastDec(T*& xpT, C xC, I xI) ...

template <class T, class C> void CastInc(T& xT, C xC) ...

template <class T, class C, class I> void CastInc(T& xT, C xC, I xI) ...

template <class T, class C> void CastInc(T*& xpT, C xpC) ...

template <class T, class C, class I> void CastInc(T*& xpT, C* xpC, I xI) ...

template <class T, class C, class I> void CastInc(T*& xpT, C xC, I xI) ...

template <class TargetType, class SouceType, class Value> void CastAssign(SouceType* target, Value v) ...

 

 

template <class T> T Sqr(const T& xT) ...

template <class T> constexpr T High() ...

template <class T> constexpr T High(const T& X) ...

template <class T> d2c_size_t High(const std::vector<T>& X) ...

template <unsigned char sz> d2c_size_t High(System::SmallString<sz>& X) ...

template <class T> T Succ(T xT) ...

template <class T> T Pred(T xT) ...

System::UnicodeString::size_type High(const System::UnicodeString& X);

System::AnsiString::size_type High(const System::AnsiString& X);

template <class T> T Low() ...

template <class T> constexpr d2c_size_t Low(const std::vector<T>& X) ...

template <class T> constexpr T Low(const T& X) ...

template<typename T, unsigned N> d2c_size_t Low(const T(&v)[N]) ...

template<typename T, unsigned N> d2c_size_t High(const T(&v)[N]) ...

System::UnicodeString::size_type Low(const System::UnicodeString& X);

System::AnsiString::size_type Low(const System::AnsiString& X);

 

void Assert( bool expr );

void Assert(bool expr, const std::wstring& Msg);

 

template <typename T> bool Assigned(const std::vector<T>* P) ...

template <typename T> bool Assigned(const std::vector<T>& P) ...

template <typename T> bool Assigned(std::function<T> P) ...

 

template <typename CH> int charLen(const CH* src) ...

template <class T> void* Addr(const T& X) ...

template <typename T> void Val(const std::wstring& S, T& V, int& Code) ...

template <typename T> void Val(const std::string& S, T& V, int& Code) ...

template <typename T> void Str(T xT, String& xs) ...

template <typename T> void Str(T xT, std::string& xs) ...

 

void Str(double xd, std::string& xs);

void Str(long double xd, std::string& xs);

void Str(int xd, int xiMinWidth, std::string& xs);

void Str(double xd, int xiMinWidth, std::string& xs);

void Str(long double xd, int xiMinWidth, std::string& xs);

void Str(long double xd, int xiMinWidth, std::string& xs);

void Str(double xd, int xiMinWidth, int xiDecPlaces, std::string& xs);

void Str(long double xd, int xiMinWidth, int xiDecPlaces, std::string& xs);

void Str(const System::Currency& xcr, int xiMinWidth, int xiDecPlaces, std::string& xs);

 

void Str(double xd, String& xs);

void Str(long double xd, String& xs);

void Str(int xd, int xiMinWidth, String& xs);

void Str(double xd, int xiMinWidth, String& xs);

void Str(long double xd, int xiMinWidth, String& xs);

void Str(long double xd, int xiMinWidth, String& xs);

void Str(double xd, int xiMinWidth, int xiDecPlaces, String& xs);

void Str(long double xd, int xiMinWidth, int xiDecPlaces, String& xs);

 

template <typename T> PChar pchar(const T& xT) ...

template <> inline PChar pchar<wchar_t>(const wchar_t& xT) ...

template <> inline PChar pchar<char>(const char& xT) ...

template <> inline PChar pchar<std::wstring>(const std::wstring& xT) ...

 

 

//http://stackoverflow.com/questions/4770968/storing-function-pointer-in-stdfunction

template <typename Signature> std::function<Signature> fptr_cast(void* f) ...

 

//http://stackoverflow.com/questions/20833453/comparing-stdfunctions-for-equality

template<typename T, typename... U> d2c_size_t getAddress(std::function<T(U...)> f) ...

 

 

HMODULE FindResourceHInstance(unsigned int Module);  // dummy function

HMODULE FindClassHInstance( const TMetaClass* ClassType ); 

HMODULE FindHInstance( void* Address );

 

template <class T> T Default() ...



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content