mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-29 08:05:46 +03:00
310 lines
12 KiB
Plaintext
310 lines
12 KiB
Plaintext
|
#pragma once
|
||
|
|
||
|
#include <cstdio>
|
||
|
#include <cstring>
|
||
|
#include <cwchar>
|
||
|
#include <xstddef>
|
||
|
|
||
|
#ifdef _MSC_VER
|
||
|
#pragma pack(push, 8)
|
||
|
#endif // _MSC_VER
|
||
|
_STD_BEGIN
|
||
|
// STREAM POSITIONING TYPES (from <streambuf_>)
|
||
|
typedef long streamoff_;
|
||
|
const streamoff_ __BADOFF = -1;
|
||
|
typedef int streamsize_;
|
||
|
#undef _Fpz
|
||
|
extern _CRTIMP2 const fpos_t _Fpz;
|
||
|
// TEMPLATE CLASS fpos_ (from <streambuf_>)
|
||
|
template<class _St>
|
||
|
class fpos_ {
|
||
|
typedef fpos_<_St> _Myt;
|
||
|
public:
|
||
|
#ifdef _MT
|
||
|
fpos_(streamoff_ _O = 0)
|
||
|
: _Off(_O), _Fpos(_Fpz)
|
||
|
{_Lockit _Lk;
|
||
|
_State = _Stz; }
|
||
|
#else
|
||
|
fpos_(streamoff_ _O = 0)
|
||
|
: _Off(_O), _Fpos(_Fpz), _State(_Stz) {}
|
||
|
#endif
|
||
|
fpos_(_St _S, fpos_t _F)
|
||
|
: _Off(0), _Fpos(_F), _State(_S) {}
|
||
|
_St state() const
|
||
|
{return (_State); }
|
||
|
void state(_St _S)
|
||
|
{_State = _S; }
|
||
|
fpos_t get_fpos_t() const
|
||
|
{return (_Fpos); }
|
||
|
operator streamoff_() const
|
||
|
{return (_Off + _FPOSOFF(_Fpos)); }
|
||
|
streamoff_ operator-(const _Myt& _R) const
|
||
|
{return ((streamoff_)*this - (streamoff_)_R); }
|
||
|
_Myt& operator+=(streamoff_ _O)
|
||
|
{_Off += _O;
|
||
|
return (*this); }
|
||
|
_Myt& operator-=(streamoff_ _O)
|
||
|
{_Off -= _O;
|
||
|
return (*this); }
|
||
|
_Myt operator+(streamoff_ _O) const
|
||
|
{_Myt _Tmp = *this;
|
||
|
return (_Tmp += _O); }
|
||
|
_Myt operator-(streamoff_ _O) const
|
||
|
{_Myt _Tmp = *this;
|
||
|
return (_Tmp -= _O); }
|
||
|
bool operator==(const _Myt& _R) const
|
||
|
{return ((streamoff_)*this == (streamoff_)_R); }
|
||
|
bool operator!=(const _Myt& _R) const
|
||
|
{return (!(*this == _R)); }
|
||
|
private:
|
||
|
static _St _Stz;
|
||
|
streamoff_ _Off;
|
||
|
fpos_t _Fpos;
|
||
|
_St _State;
|
||
|
};
|
||
|
template<class _St>
|
||
|
_St fpos_<_St>::_Stz;
|
||
|
typedef fpos_<mbstate_t> streampos_;
|
||
|
typedef streampos_ wstreampos_;
|
||
|
// TEMPLATE STRUCT char_traits_ (FROM <string>)
|
||
|
template<class _E>
|
||
|
struct char_traits_ {
|
||
|
typedef _E char_type;
|
||
|
typedef _E int_type;
|
||
|
typedef streampos_ pos_type;
|
||
|
typedef streamoff_ off_type;
|
||
|
typedef mbstate_t state_type;
|
||
|
static void __cdecl assign(_E& _X, const _E& _Y)
|
||
|
{_X = _Y; }
|
||
|
static bool __cdecl eq(const _E& _X, const _E& _Y)
|
||
|
{return (_X == _Y); }
|
||
|
static bool __cdecl lt(const _E& _X, const _E& _Y)
|
||
|
{return (_X < _Y); }
|
||
|
static int __cdecl compare(const _E *_U, const _E *_V, size_t _N)
|
||
|
{for (size_t _I = 0; _I < _N; ++_I, ++_U, ++_V)
|
||
|
if (!eq(*_U, *_V))
|
||
|
return (lt(*_U, *_V) ? -1 : +1);
|
||
|
return (0); }
|
||
|
static size_t __cdecl length(const _E *_U)
|
||
|
{size_t _N;
|
||
|
for (_N = 0; !eq(*_U, _E(0)); ++_U)
|
||
|
++_N;
|
||
|
return (_N); }
|
||
|
static _E * __cdecl copy(_E *_U, const _E *_V, size_t _N)
|
||
|
{_E *_S = _U;
|
||
|
for (; 0 < _N; --_N, ++_U, ++_V)
|
||
|
assign(*_U, *_V);
|
||
|
return (_S); }
|
||
|
static const _E * __cdecl find(const _E *_U, size_t _N,
|
||
|
const _E& _C)
|
||
|
{for (; 0 < _N; --_N, ++_U)
|
||
|
if (eq(*_U, _C))
|
||
|
return (_U);
|
||
|
return (0); }
|
||
|
static _E * __cdecl move(_E *_U, const _E *_V, size_t _N)
|
||
|
{_E *_Ans = _U;
|
||
|
if (_V < _U && _U < _V + _N)
|
||
|
for (_U += _N, _V += _N; 0 < _N; --_N)
|
||
|
assign(*--_U, *--_V);
|
||
|
else
|
||
|
for (; 0 < _N; --_N, ++_U, ++_V)
|
||
|
assign(*_U, *_V);
|
||
|
return (_Ans); }
|
||
|
static _E * __cdecl assign(_E *_U, size_t _N, const _E& _C)
|
||
|
{_E *_Ans = _U;
|
||
|
for (; 0 < _N; --_N, ++_U)
|
||
|
assign(*_U, _C);
|
||
|
return (_Ans); }
|
||
|
static _E __cdecl to_char_type(const int_type& _C)
|
||
|
{return ((_E)_C); }
|
||
|
static int_type __cdecl to_int_type(const _E& _C)
|
||
|
{return ((int_type)_C); }
|
||
|
static bool __cdecl eq_int_type(const int_type& _X,
|
||
|
const int_type& _Y)
|
||
|
{return (_X == _Y); }
|
||
|
static int_type __cdecl eof()
|
||
|
{return (EOF); }
|
||
|
static int_type __cdecl not_eof(const int_type& _C)
|
||
|
{return (_C != eof() ? _C : !eof()); }
|
||
|
};
|
||
|
// STRUCT char_traits_<wchar_t>
|
||
|
template<> struct _CRTIMP2 char_traits_<wchar_t> {
|
||
|
typedef wchar_t _E;
|
||
|
typedef _E char_type; // for overloads
|
||
|
typedef wint_t int_type;
|
||
|
typedef streampos_ pos_type;
|
||
|
typedef streamoff_ off_type;
|
||
|
typedef mbstate_t state_type;
|
||
|
static void __cdecl assign(_E& _X, const _E& _Y)
|
||
|
{_X = _Y; }
|
||
|
static bool __cdecl eq(const _E& _X, const _E& _Y)
|
||
|
{return (_X == _Y); }
|
||
|
static bool __cdecl lt(const _E& _X, const _E& _Y)
|
||
|
{return (_X < _Y); }
|
||
|
static int __cdecl compare(const _E *_U, const _E *_V, size_t _N)
|
||
|
{return (wmemcmp(_U, _V, _N)); }
|
||
|
static size_t __cdecl length(const _E *_U)
|
||
|
{return (wcslen(_U)); }
|
||
|
static _E *__cdecl copy(_E *_U, const _E *_V, size_t _N)
|
||
|
{return (wmemcpy(_U, _V, _N)); }
|
||
|
static const _E * __cdecl find(const _E *_U, size_t _N,
|
||
|
const _E& _C)
|
||
|
{return ((const _E *)wmemchr(_U, _C, _N)); }
|
||
|
static _E * __cdecl move(_E *_U, const _E *_V, size_t _N)
|
||
|
{return (wmemmove(_U, _V, _N)); }
|
||
|
static _E * __cdecl assign(_E *_U, size_t _N, const _E& _C)
|
||
|
{return (wmemset(_U, _C, _N)); }
|
||
|
static _E __cdecl to_char_type(const int_type& _C)
|
||
|
{return ((_E)_C); }
|
||
|
static int_type __cdecl to_int_type(const _E& _C)
|
||
|
{return ((int_type)_C); }
|
||
|
static bool __cdecl eq_int_type(const int_type& _X,
|
||
|
const int_type& _Y)
|
||
|
{return (_X == _Y); }
|
||
|
static int_type __cdecl eof()
|
||
|
{return (WEOF); }
|
||
|
static int_type __cdecl not_eof(const int_type& _C)
|
||
|
{return (_C != eof() ? _C : !eof()); }
|
||
|
};
|
||
|
// STRUCT char_traits_<char> (FROM <string>)
|
||
|
template<> struct _CRTIMP2 char_traits_<char> {
|
||
|
typedef char _E;
|
||
|
typedef _E char_type;
|
||
|
typedef int int_type;
|
||
|
typedef streampos_ pos_type;
|
||
|
typedef streamoff_ off_type;
|
||
|
typedef mbstate_t state_type;
|
||
|
static void __cdecl assign(_E& _X, const _E& _Y)
|
||
|
{_X = _Y; }
|
||
|
static bool __cdecl eq(const _E& _X, const _E& _Y)
|
||
|
{return (_X == _Y); }
|
||
|
static bool __cdecl lt(const _E& _X, const _E& _Y)
|
||
|
{return (_X < _Y); }
|
||
|
static int __cdecl compare(const _E *_U, const _E *_V, size_t _N)
|
||
|
{return (memcmp(_U, _V, _N)); }
|
||
|
static size_t __cdecl length(const _E *_U)
|
||
|
{return (strlen(_U)); }
|
||
|
static _E * __cdecl copy(_E *_U, const _E *_V, size_t _N)
|
||
|
{return ((_E *)memcpy(_U, _V, _N)); }
|
||
|
static const _E * __cdecl find(const _E *_U, size_t _N,
|
||
|
const _E& _C)
|
||
|
{return ((const _E *)memchr(_U, _C, _N)); }
|
||
|
static _E * __cdecl move(_E *_U, const _E *_V, size_t _N)
|
||
|
{return ((_E *)memmove(_U, _V, _N)); }
|
||
|
static _E * __cdecl assign(_E *_U, size_t _N, const _E& _C)
|
||
|
{return ((_E *)memset(_U, _C, _N)); }
|
||
|
static _E __cdecl to_char_type(const int_type& _C)
|
||
|
{return ((_E)_C); }
|
||
|
static int_type __cdecl to_int_type(const _E& _C)
|
||
|
{return ((int_type)((unsigned char)_C)); }
|
||
|
static bool __cdecl eq_int_type(const int_type& _X,
|
||
|
const int_type& _Y)
|
||
|
{return (_X == _Y); }
|
||
|
static int_type __cdecl eof()
|
||
|
{return (EOF); }
|
||
|
static int_type __cdecl not_eof(const int_type& _C)
|
||
|
{return (_C != eof() ? _C : !eof()); }
|
||
|
};
|
||
|
// FORWARD REFERENCES
|
||
|
template<class T>
|
||
|
class allocator_;
|
||
|
class ios_base;
|
||
|
template<class _E, class _Tr = char_traits_<_E> >
|
||
|
class basic_ios;
|
||
|
template<class _E, class _Tr = char_traits_<_E> >
|
||
|
class istreambuf_iterator_;
|
||
|
template<class _E, class _Tr = char_traits_<_E> >
|
||
|
class ostreambuf_iterator_;
|
||
|
template<class _E, class _Tr = char_traits_<_E> >
|
||
|
class basic_streambuf;
|
||
|
template<class _E, class _Tr = char_traits_<_E> >
|
||
|
class basic_istream;
|
||
|
template<class _E, class _Tr = char_traits_<_E> >
|
||
|
class basic_ostream;
|
||
|
template<class _E, class _Tr = char_traits_<_E> >
|
||
|
class basic_iostream;
|
||
|
template<class _E, class _Tr = char_traits_<_E>,
|
||
|
class _A = allocator_<_E> >
|
||
|
class basic_stringbuf;
|
||
|
template<class _E, class _Tr = char_traits_<_E>,
|
||
|
class _A = allocator_<_E> >
|
||
|
class basic_istringstream;
|
||
|
template<class _E, class _Tr = char_traits_<_E>,
|
||
|
class _A = allocator_<_E> >
|
||
|
class basic_ostringstream;
|
||
|
template<class _E, class _Tr = char_traits_<_E>,
|
||
|
class _A = allocator_<_E> >
|
||
|
class basic_stringstream;
|
||
|
template<class _E, class _Tr = char_traits_<_E> >
|
||
|
class basic_filebuf;
|
||
|
template<class _E, class _Tr = char_traits_<_E> >
|
||
|
class basic_ifstream;
|
||
|
template<class _E, class _Tr = char_traits_<_E> >
|
||
|
class basic_ofstream;
|
||
|
template<class _E, class _Tr = char_traits_<_E> >
|
||
|
class basic_fstream;
|
||
|
|
||
|
// char TYPEDEFS
|
||
|
typedef basic_ios<char, char_traits_<char> > ios_;
|
||
|
typedef basic_streambuf<char, char_traits_<char> > streambuf_;
|
||
|
typedef basic_istream<char, char_traits_<char> > istream_;
|
||
|
typedef basic_ostream<char, char_traits_<char> > ostream_;
|
||
|
typedef basic_iostream<char, char_traits_<char> > iostream_;
|
||
|
typedef basic_stringbuf<char, char_traits_<char>,
|
||
|
allocator_<char> > stringbuf_;
|
||
|
typedef basic_istringstream<char, char_traits_<char>,
|
||
|
allocator_<char> > istringstream_;
|
||
|
typedef basic_ostringstream<char, char_traits_<char>,
|
||
|
allocator_<char> > ostringstream_;
|
||
|
typedef basic_stringstream<char, char_traits_<char>,
|
||
|
allocator_<char> > stringstream_;
|
||
|
typedef basic_filebuf<char, char_traits_<char> > filebuf_;
|
||
|
typedef basic_ifstream<char, char_traits_<char> > ifstream_;
|
||
|
typedef basic_ofstream<char, char_traits_<char> > ofstream_;
|
||
|
typedef basic_fstream<char, char_traits_<char> > fstream_;
|
||
|
// wchar_t TYPEDEFS
|
||
|
typedef basic_ios<wchar_t, char_traits_<wchar_t> > wios_;
|
||
|
typedef basic_streambuf<wchar_t, char_traits_<wchar_t> >
|
||
|
wstreambuf_;
|
||
|
typedef basic_istream<wchar_t, char_traits_<wchar_t> > wistream_;
|
||
|
typedef basic_ostream<wchar_t, char_traits_<wchar_t> > wostream_;
|
||
|
typedef basic_iostream<wchar_t, char_traits_<wchar_t> > wiostream_;
|
||
|
typedef basic_stringbuf<wchar_t, char_traits_<wchar_t>,
|
||
|
allocator_<wchar_t> > wstringbuf_;
|
||
|
typedef basic_istringstream<wchar_t, char_traits_<wchar_t>,
|
||
|
allocator_<wchar_t> > wistringstream_;
|
||
|
typedef basic_ostringstream<wchar_t, char_traits_<wchar_t>,
|
||
|
allocator_<wchar_t> > wostringstream_;
|
||
|
typedef basic_stringstream<wchar_t, char_traits_<wchar_t>,
|
||
|
allocator_<wchar_t> > wstringstream_;
|
||
|
typedef basic_filebuf<wchar_t, char_traits_<wchar_t> > wfilebuf_;
|
||
|
typedef basic_ifstream<wchar_t, char_traits_<wchar_t> > wifstream_;
|
||
|
typedef basic_ofstream<wchar_t, char_traits_<wchar_t> > wofstream_;
|
||
|
typedef basic_fstream<wchar_t, char_traits_<wchar_t> > wfstream_;
|
||
|
|
||
|
#ifdef _DLL
|
||
|
template<class _E, class _II >
|
||
|
class num_get;
|
||
|
template<class _E, class _OI >
|
||
|
class num_put;
|
||
|
template<class _E>
|
||
|
class collate;
|
||
|
|
||
|
typedef num_get<char, istreambuf_iterator_<char, char_traits_<char> > > numget_;
|
||
|
typedef num_get<wchar_t, istreambuf_iterator_<wchar_t, char_traits_<wchar_t> > > wnumget_;
|
||
|
|
||
|
typedef num_put<char, ostreambuf_iterator_<char, char_traits_<char> > > numput_;
|
||
|
typedef num_put<wchar_t, ostreambuf_iterator_<wchar_t, char_traits_<wchar_t> > > wnumput_;
|
||
|
|
||
|
typedef collate<char> ncollate;
|
||
|
typedef collate<wchar_t> wcollate;
|
||
|
|
||
|
#endif // _DLL
|
||
|
|
||
|
_STD_END
|
||
|
|
||
|
#ifdef _MSC_VER
|
||
|
#pragma pack(pop)
|
||
|
#endif // _MSC_VER
|