1 #ifndef __UTILITIES_HPP__ 2 #define __UTILITIES_HPP__ 8 #include "system_detection.inl" 10 #if _MSC_VER > 0 && _MSC_VER < 1201 11 #pragma warning( disable: 4786 ) 14 #pragma warning( disable : 4996 ) 45 #if defined(_MSC_VER) || defined(WIN32) 46 #pragma warning( disable: 4251 ) 47 #pragma warning( disable: 4275 ) 48 #ifdef WINUX_DLL_EXPORTS 49 #define WINUX_DLL __declspec(dllexport) 51 #define WINUX_DLL __declspec(dllimport) 54 #define WINUX_API __stdcall 64 #define WINUX_FUNC_DECL(ret) WINUX_DLL ret WINUX_API 65 #define WINUX_FUNC_IMPL(ret) ret WINUX_API 68 #define countof(arr) ( sizeof(arr) / sizeof(arr[0]) ) 73 #define TEXT(__x) L##__x 81 #define DISABLE_OBJECT_COPY( clsname ) private:\ 82 clsname( clsname const & ) = delete;\ 83 clsname & operator = ( clsname const & ) = delete; 86 #define CBufferToAnsiString( buf, size ) winux::AnsiString( (char const *)(buf), (size_t)(size) ) 88 #define CBufferToBuffer( buf, size ) winux::Buffer( (void *)(buf), (size_t)(size), false ) 90 #define CBufferToBufferPeek( buf, size ) winux::Buffer( (void *)(buf), (size_t)(size), true ) 94 #define IF_PTR(ptr) if ( (ptr) != NULL ) (ptr) 96 #define ASSIGN_PTR(ptr) if ( (ptr) != NULL ) (*(ptr)) 104 #define DEFINE_ATTR_MEMBER( ty, name, memname ) \ 106 ty const & get##name() const { return this->##memname; }\ 107 void set##name( ty const & v ) { this->##memname = v; }\ 112 #define DEFINE_ATTR_MEMBER_READONLY( ty, name, memname ) \ 114 ty const & get##name() const { return this->##memname; }\ 119 #define DEFINE_ATTR( ty, name, getcode, setcode ) \ 121 ty get##name() const { getcode; }\ 122 void set##name( ty const & _VAL_ ) { setcode; } 125 #define DEFINE_ATTR_READONLY( ty, name, getcode ) \ 127 ty get##name() const { getcode; } 130 #define DEFINE_FUNC_NEWINSTANCE( cls, ret, paramtypes, params ) \ 131 inline static ret * NewInstance##paramtypes \ 133 return new cls##params;\ 137 #define DEFINE_CUSTOM_EVENT(evtname, paramtypes, calledparams) \ 139 using evtname##HandlerFunction = std::function< void paramtypes >; \ 140 void on##evtname##Handler( evtname##HandlerFunction handler ) \ 142 this->_##evtname##Handler = handler; \ 145 evtname##HandlerFunction _##evtname##Handler; \ 146 virtual void on##evtname paramtypes \ 148 if ( this->_##evtname##Handler ) this->_##evtname##Handler calledparams; \ 152 #define DEFINE_CUSTOM_EVENT_RETURN_EX(ret, evtname, paramtypes) \ 154 using evtname##HandlerFunction = std::function< ret paramtypes >; \ 155 void on##evtname##Handler( evtname##HandlerFunction handler ) \ 157 this->_##evtname##Handler = handler; \ 160 evtname##HandlerFunction _##evtname##Handler; \ 161 virtual ret on##evtname paramtypes 165 #define GCC_VERSION_GREAT_THAN(Major,Minor,Patchlevel) \ 166 ( __GNUC__ > Major || ( __GNUC__ == Major && ( __GNUC_MINOR__ > Minor || ( __GNUC_MINOR__ == Minor && __GNUC_PATCHLEVEL__ > Patchlevel ) ) ) ) 190 typedef wchar_t wchar;
191 typedef unsigned long long uint64;
193 typedef long long int64;
209 template <
typename _ChTy >
218 template <
typename _ChTy >
240 static constexpr
size_t const npos =
static_cast<size_t>(-1);
244 template <
typename _Ty >
248 for (
int i = 0; i < sizeof(_Ty); ++i ) v2 |= ( ( v >> i * 8 ) & 0xFFU ) << (
sizeof(_Ty) - 1 - i ) * 8;
267 template <
typename _MAP,
typename _KEY >
268 inline bool isset( _MAP
const & m, _KEY
const & k )
270 return m.find(k) != m.end();
274 template <
typename _Ty >
275 std::vector<_Ty>
ToArray( _Ty * arr, uint count )
277 return std::vector<_Ty>( arr, arr + count );
280 template <
typename _Ty, u
int _N >
283 return std::vector<_Ty>( arr, arr + _N );
289 template <
typename _Fx,
typename... _ArgType >
292 fn( std::forward<_ArgType>(arg)... );
297 template < u
int64 n >
struct Bin0 303 enum : uint64 {
val = 0 };
307 #define BinVal(x) winux::Bin0<0##x>::val 310 template <
typename _Ty >
319 operator ParamTypeRef () {
return _r; }
323 template <
typename _Ty >
330 template <
size_t... _Index >
334 template <
size_t _Num,
typename _IdxSeq = IndexSequence<> >
337 template <
size_t _Num,
size_t... _Index >
340 template <
size_t... _Index >
347 #include "func_traits.inl" 350 #include "func_runable.inl" 353 #include "func_invoker.inl" 356 template <
typename _PfnType, _PfnType pfn >
359 template <
typename... _ArgType >
362 return (*pfn)( std::forward<_ArgType>(arg)... );
367 template <
typename _KTy,
typename _VTy >
370 std::map< _KTy, _VTy > * _m;
379 operator std::map< _KTy, _VTy > & () {
return *_m; }
383 template <
typename _Ty >
386 std::vector<_Ty> * _a;
394 operator std::vector<_Ty> & () {
return *_a; }
398 template <
typename _KTy,
typename _VTy >
405 template <
typename _Ty >
416 template <
typename _TargetCls >
429 if ( &other !=
this )
431 *_data = *other._data;
436 #ifndef MOVE_SEMANTICS_DISABLED 440 other._data =
nullptr;
445 if ( &other !=
this )
449 other._data =
nullptr;
460 delete (_TargetCls *)_data;
466 template <
typename... _ArgType >
470 _data =
new _TargetCls( std::forward<_ArgType>(arg)... );
473 _TargetCls *
get()
const 478 _TargetCls * operator -> ()
482 _TargetCls
const * operator -> ()
const 487 operator _TargetCls & ()
491 operator _TargetCls
const & ()
const 496 operator bool()
const 498 return _data !=
nullptr;
512 Error(
int errType, AnsiString
const & errStr )
throw() : _errType(errType), _errStr(errStr) { }
515 virtual char const *
what()
const throw() {
return _errStr.c_str(); }
537 Buffer(
void const * buf,
size_t size,
bool isPeek =
false );
542 Buffer( AnsiString
const & data,
bool isPeek =
false );
550 #ifndef MOVE_SEMANTICS_DISABLED 562 void setBuf(
void const * buf,
size_t size,
size_t capacity,
bool isPeek );
565 void setBuf(
void const * buf,
size_t size,
bool isPeek ) { this->
setBuf( buf, size, size, isPeek ); }
568 void alloc(
size_t capacity,
bool setDataSize =
true );
573 void realloc(
size_t newCapacity );
576 bool peekCopy(
bool copyCapacity =
false );
579 void * detachBuf(
size_t * size =
nullptr );
588 template <
typename _Ty >
589 _Ty *
getBuf()
const {
return reinterpret_cast<_Ty *
>(_buf); }
592 void *
get()
const {
return _buf; }
595 template <
typename _Ty >
596 _Ty *
get()
const {
return reinterpret_cast<_Ty *
>(_buf); }
616 size_t size()
const {
return _dataSize; }
619 void _setSize(
size_t dataSize ) { _dataSize = ( dataSize > _capacity ? _capacity : dataSize ); }
628 operator bool()
const {
return _buf != NULL; }
631 template <
typename _ChTy >
635 return XString<_ChTy>( (CharType*)_buf, _dataSize /
sizeof(CharType) );
639 AnsiString
toAnsi()
const {
return this->toString<AnsiString::value_type>(); }
642 UnicodeString
toUnicode()
const {
return this->toString<UnicodeString::value_type>(); }
645 static void * _Alloc(
size_t size );
646 static void * _Realloc(
void * p,
size_t newSize );
647 static void _Free(
void * p );
669 #ifndef MOVE_SEMANTICS_DISABLED 681 void append(
void const * data,
size_t size );
684 void append( AnsiString
const & data ) { this->
append( data.c_str(), data.size() ); }
690 template <
typename _PodType,
size_t _Size = sizeof(_PodType) >
694 template <
typename _PodType,
size_t _Count >
695 void append( _PodType
const (&data)[_Count] ) { this->
append( &data, _Count *
sizeof(data[0]) ); }
698 template <
typename _PodType >
699 void append( std::initializer_list<_PodType> list )
701 for (
auto const & e : list )
703 this->append< _PodType, sizeof(e) >(e);
708 void erase(
size_t start,
size_t count = (
size_t)-1 );
728 MixedError(
int errType, AnsiString
const & errStr )
throw() :
Error( errType, errStr ) { }
735 $a( std::initializer_list<Mixed> list ) : _list(
std::move(list) )
743 std::initializer_list< std::pair< Mixed, Mixed > >
_list;
744 $c( std::initializer_list< std::pair< Mixed, Mixed > > list ) : _list(
std::move(list) )
755 #define MixedType_ENUM_ITEM(item) item, 756 #define MixedType_ENUM_ITEMSTRING(item) #item, 757 #define MixedType_ENUM_ITEMLIST(_)\ 761 _(MT_SHORT) _(MT_USHORT)\ 762 _(MT_INT) _(MT_UINT)\ 763 _(MT_LONG) _(MT_ULONG)\ 764 _(MT_INT64) _(MT_UINT64)\ 765 _(MT_FLOAT) _(MT_DOUBLE)\ 766 _(MT_ANSI) _(MT_UNICODE)\ 771 MixedType_ENUM_ITEMLIST(MixedType_ENUM_ITEM) 775 static String
const & TypeString( MixedType type );
780 bool operator () (
Mixed const & v1,
Mixed const & v2 )
const;
807 UnicodeString * _pWStr;
813 MixedMixedMap * _pMap;
823 Mixed( AnsiString
const & str );
824 Mixed( UnicodeString
const & str );
825 Mixed(
char const * str,
size_t len = npos );
826 Mixed( wchar
const * str,
size_t len = npos );
828 Mixed(
bool boolVal );
830 Mixed(
short shVal );
831 Mixed( ushort ushVal );
835 Mixed( ulong ulVal );
836 Mixed(
float fltVal );
837 Mixed( int64 i64Val );
838 Mixed( uint64 ui64Val );
839 Mixed(
double dblVal );
842 Mixed(
void const * binaryData,
size_t size,
bool isPeek =
false );
849 template <
typename _Ty >
850 Mixed( std::vector<_Ty>
const & arr )
853 this->_type = MT_ARRAY;
856 for ( i = 0; i < arr.size(); ++i )
858 this->_pArr->at(i) = arr[i];
863 template <
typename _Ty,
size_t _N >
864 Mixed( _Ty (&arr)[_N] )
867 this->_type = MT_ARRAY;
870 for ( i = 0; i < _N; ++i )
872 this->_pArr->at(i) = arr[i];
877 Mixed( std::initializer_list<Mixed> list );
884 template <
typename _KTy,
typename _VTy,
typename _Pr,
typename _Alloc >
885 Mixed( std::map< _KTy, _VTy, _Pr, _Alloc >
const & m )
888 this->assign< _KTy, _VTy, _Pr, _Alloc >(m);
892 template <
typename _KTy,
typename _VTy,
size_t _Count >
893 Mixed( std::pair< _KTy, _VTy > (&pairs)[_Count] )
896 this->assign< _KTy, _VTy, _Count >(pairs);
900 template <
typename _KTy,
typename _VTy,
size_t _Count >
901 Mixed( _KTy (&keys)[_Count], _VTy (&vals)[_Count] )
904 this->assign< _KTy, _VTy, _Count >( keys, vals );
914 Mixed( Mixed
const & other );
916 Mixed & operator = ( Mixed
const & other );
918 #ifndef MOVE_SEMANTICS_DISABLED 920 Mixed( Mixed && other );
922 Mixed & operator = ( Mixed && other );
925 void assign(
Buffer && buf );
936 MixedType type()
const {
return this->_type; }
938 String
const & typeString()
const {
return TypeString(this->_type); }
941 template <
typename _ChTy >
943 template <
typename _ChTy >
945 #include "mixed_ref_specified_type.inl" 951 operator bool()
const;
952 operator byte()
const;
953 operator short()
const;
955 operator int()
const;
956 operator uint()
const;
957 operator long()
const;
958 operator ulong()
const;
959 operator float()
const;
960 operator int64()
const;
962 operator double()
const;
964 template <
typename _ChTy >
966 AnsiString toAnsi()
const {
return this->
operator AnsiString(); }
969 bool toBool()
const {
return this->
operator bool(); }
971 short toShort()
const {
return this->
operator short(); }
973 int toInt()
const {
return this->
operator int(); }
975 long toLong()
const {
return this->
operator long(); }
977 float toFloat()
const {
return this->
operator float(); }
980 double toDouble()
const {
return this->
operator double(); }
983 bool operator == ( Mixed
const & other )
const;
984 bool operator < ( Mixed
const & other )
const;
985 bool operator != ( Mixed
const & other )
const {
return !this->operator == (other); }
986 bool operator > ( Mixed
const & other )
const {
return !this->operator <= (other); }
987 bool operator >= ( Mixed
const & other )
const {
return !this->operator < (other); }
988 bool operator <= ( Mixed
const & other )
const {
return this->operator < (other) || this->operator == (other); }
991 bool isNull()
const {
return this->_type == MT_NULL; }
992 bool isArray()
const {
return this->_type == MT_ARRAY; }
993 bool isCollection()
const {
return this->_type == MT_COLLECTION; }
994 bool isContainer()
const {
return this->_type == MT_ARRAY || this->_type == MT_COLLECTION; }
995 bool isBinary()
const {
return this->_type == MT_BINARY; }
996 bool isNumeric()
const {
return this->_type > MT_NULL && this->_type < MT_ANSI; }
997 bool isInteger()
const {
return this->isNumeric() && this->_type != MT_FLOAT && this->_type != MT_DOUBLE; }
998 bool isAnsi()
const {
return this->_type == MT_ANSI; }
999 bool isUnicode()
const {
return this->_type == MT_UNICODE; }
1000 bool isString()
const {
return this->_type == MT_ANSI || this->_type == MT_UNICODE; }
1004 template <
typename _ChTy >
1005 Mixed & createString();
1007 Mixed & createAnsi();
1009 Mixed & createUnicode();
1011 Mixed & createArray(
size_t count = 0 );
1013 Mixed & createCollection();
1015 Mixed & createBuffer(
size_t size = 0 );
1022 template <
typename _Ty >
1023 size_t getArray( std::vector<_Ty> * arr )
const 1026 MixedArray::const_iterator it;
1027 for ( it = this->_pArr->begin(); it != this->_pArr->end(); ++it )
1028 arr->push_back(*it);
1035 template <
typename _KTy >
1036 size_t getKeys( std::vector<_KTy> * keys )
const 1039 MixedArray::const_iterator it;
1040 for ( it = this->_pArr->begin(); it != this->_pArr->end(); ++it )
1041 keys->push_back(*it);
1042 return keys->size();
1048 template <
typename _KTy,
typename _VTy >
1049 size_t getMap( std::map< _KTy, _VTy > * m )
const 1052 MixedMixedMap::const_iterator it;
1053 for ( it = this->_pMap->begin(); it != this->_pMap->end(); ++it )
1054 (*m)[(_KTy)it->first] = (_VTy)it->second;
1061 bool isEmpty()
const {
return this->getCount() == 0; }
1066 size_t getCount()
const 1068 if ( ( this->isArray() || this->isCollection() ) && this->_pArr != NULL )
1069 return this->_pArr->size();
1074 Mixed & operator [] ( Mixed
const & k );
1076 Mixed
const & operator [] ( Mixed
const & k )
const;
1078 template <
typename _ChTy >
1079 Mixed & operator [] ( _ChTy
const * k ) {
return this->operator[]( Mixed(k) ); }
1081 template <
typename _ChTy >
1082 Mixed
const & operator [] ( _ChTy
const * k )
const {
return this->operator[]( Mixed(k) ); }
1085 template <
typename _Ty >
1086 _Ty
get( Mixed
const & k, Mixed
const & defval = Mixed() )
const {
return (_Ty)this->
get( k, defval ); }
1089 Mixed
const &
get( Mixed
const & k, Mixed
const & defval = Mixed() )
const;
1092 MixedMixedMap::value_type & getPair(
size_t i );
1094 MixedMixedMap::value_type
const & getPair(
size_t i )
const;
1102 if ( _mx->isCollection() )
1104 _mx->_addUniqueKey(k);
1105 _mx->_pMap->operator[](k) = v;
1109 operator Mixed & () {
return *_mx; }
1120 if ( this->_type != MT_COLLECTION ) this->createCollection();
1125 Mixed & addPair( Mixed
const & k, Mixed
const & v );
1133 if ( _mx->isArray() )
1135 _mx->_pArr->push_back(v);
1139 operator Mixed & () {
return *_mx; }
1150 if ( this->_type != MT_ARRAY ) this->createArray();
1155 size_t add( Mixed
const & v );
1158 size_t addUnique( Mixed
const & v );
1161 void del( Mixed
const & k );
1166 bool has( Mixed
const & ek )
const;
1171 Mixed & merge( Mixed
const & v );
1180 void alloc(
size_t size,
bool setDataSize =
true );
1185 bool peekCopy(
bool copyCapacity =
false );
1190 size_t getSize()
const;
1195 void * getBuf()
const;
1198 void assign(
char const * str,
size_t len = npos );
1199 void assign( wchar
const * str,
size_t len = npos );
1200 void assign(
bool boolVal );
1201 void assign( byte btVal );
1202 void assign(
short shVal );
1203 void assign( ushort ushVal );
1204 void assign(
int iVal );
1205 void assign( uint uiVal );
1206 void assign(
long lVal );
1207 void assign( ulong ulVal );
1208 void assign(
float fltVal );
1209 void assign( int64 i64Val );
1210 void assign( uint64 ui64Val );
1211 void assign(
double dblVal );
1213 void assign(
Buffer const & buf );
1215 void assign(
void const * binaryData,
size_t size,
bool isPeek =
false );
1217 void assign( Mixed * arr,
size_t count );
1220 template <
typename _Ty >
1221 void assign( std::vector<_Ty>
const & arr )
1224 this->_type = MT_ARRAY;
1227 for ( i = 0; i < arr.size(); ++i )
1229 this->_pArr->at(i) = arr[i];
1234 template <
typename _Ty,
size_t _N >
1235 void assign( _Ty (&arr)[_N] )
1238 this->_type = MT_ARRAY;
1241 for ( i = 0; i < _N; ++i )
1243 this->_pArr->at(i) = arr[i];
1248 void assign( std::initializer_list<Mixed> list );
1251 void assign(
$a arr );
1254 template <
typename _KTy,
typename _VTy,
typename _Pr,
typename _Alloc >
1255 void assign( std::map< _KTy, _VTy, _Pr, _Alloc >
const & m )
1258 this->_type = MT_COLLECTION;
1260 this->_pMap =
new MixedMixedMap();
1261 typename std::map< _KTy, _VTy, _Pr, _Alloc >::const_iterator it;
1262 for ( it = m.begin(); it != m.end(); ++it )
1264 this->_pArr->push_back(it->first);
1265 (*this->_pMap)[it->first] = it->second;
1270 template <
typename _KTy,
typename _VTy,
size_t _Count >
1271 void assign( std::pair< _KTy, _VTy > (&pairs)[_Count] )
1274 this->_type = MT_COLLECTION;
1276 this->_pMap =
new MixedMixedMap();
1278 for ( i = 0; i < _Count; ++i )
1280 this->_addUniqueKey(pairs[i].first);
1281 (*this->_pMap)[pairs[i].first] = pairs[i].second;
1286 template <
typename _KTy,
typename _VTy,
size_t _Count >
1287 void assign( _KTy (&keys)[_Count], _VTy (&vals)[_Count] )
1290 this->_type = MT_COLLECTION;
1292 this->_pMap =
new MixedMixedMap();
1294 for ( i = 0; i < _Count; ++i )
1296 this->_addUniqueKey(keys[i]);
1297 (*this->_pMap)[keys[i]] = vals[i];
1302 void assign(
$c coll );
1305 String myJson(
bool autoKeyQuotes =
true, AnsiString
const & spacer =
"", AnsiString
const & newline =
"" )
const;
1306 String json()
const;
1307 Mixed & json( String
const & jsonStr );
1311 static bool ParseBool( AnsiString
const & str,
bool * boolVal );
1312 static bool ParseBool( UnicodeString
const & str,
bool * boolVal );
1314 static bool ParseULong( AnsiString
const & str, ulong * ulVal );
1315 static bool ParseULong( UnicodeString
const & str, ulong * ulVal );
1317 static bool ParseDouble( AnsiString
const & str,
double * dblVal );
1318 static bool ParseDouble( UnicodeString
const & str,
double * dblVal );
1320 static bool ParseUInt64( AnsiString
const & str, uint64 * ui64Val );
1321 static bool ParseUInt64( UnicodeString
const & str, uint64 * ui64Val );
1324 static Mixed & ParseJson( AnsiString
const & str, Mixed * val );
1329 void _addUniqueKey( Mixed
const & k )
1331 if ( this->_pMap->find(k) == this->_pMap->end() )
1332 this->_pArr->push_back(k);
1339 return this->refAnsi();
1345 return this->refAnsi();
1351 return this->refUnicode();
1357 return this->refUnicode();
1364 return this->toAnsi();
1371 return this->toUnicode();
1376 inline Mixed & Mixed::createString<char>()
1378 return this->createAnsi();
1383 inline Mixed & Mixed::createString<wchar>()
1385 return this->createUnicode();
1397 #endif // __UTILITIES_HPP__ XString< char > AnsiString
XString< char32 > UnicodeString32
static bool IsLittleEndian()
判断编译环境是否为小端序
XString< wchar > UnicodeString
函数包装,用来将不同调用约定的函数统一包装成默认约定
void * getBuf() const
暴露缓冲区指针
AnsiString toAnsi() const
转换到AnsiString
std::map< String, Mixed > StringMixedMap
MapAssigner< _KTy, _VTy > Assign(std::map< _KTy, _VTy > *m)
给容器赋值
void create(_ArgType &&...arg)
必须在使用者类的构造函数里第一个调用
winux::byte const * begin() const
std::initializer_list< std::pair< Mixed, Mixed > > _list
int VoidReturnInt(_Fx fn, _ArgType &&...arg)
调用一个返回void的函数或函数对象,返回一个数字
MembersWrapper(MembersWrapper &&other)
XStringArray< char16 > UnicodeString16Array
$a(std::initializer_list< Mixed > list)
std::pair< String, Mixed > StringMixedPair
XStringArray< char16 > Utf16StringArray
size_t capacity() const
获取容量大小
XString< _ChTy > toString() const
转换到字符串
bool ValueIsInArray(StringArray const &arr, String const &val, bool caseInsensitive=false)
判断一个字符串值是否在一个字符串数组里,默认大小写敏感
std::map< String, String > StringStringMap
void destroy()
必须在使用者类的析构函数里最后一个调用
size_t getSize() const
获取数据大小
std::vector< XString< _ChTy > > XStringArray
std::ostream & operator<<(std::ostream &o, ConsoleAttrT< _VarType > const &tr)
_Ty * getBuf() const
暴露缓冲区指针
XString< char32 > Utf32String
int Random(int n1, int n2)
随机数,随机产生n1~n2的数字. 包括n1,n2本身
static constexpr size_t const npos
非位置,值为-1。
XStringArray< char > AnsiStringArray
std::vector< Mixed > MixedArray
缓冲区,表示内存中一块二进制数据(利用malloc/realloc进行内存分配)
std::map< Mixed, Mixed, MixedLess > MixedMixedMap
static bool IsBigEndian()
判断编译环境是否为大端序
XStringArray< char > Utf8StringArray
MixedMixedMap::value_type MixedMixedPair
void append(_PodType const &data)
添加数据:POD类型变量
XString< char > Utf8String
bool isset(_MAP const &m, _KEY const &k)
检测map中是否有该键的值
void _setSize(size_t dataSize)
设置数据大小,不能超过容量大小(不建议外部调用)
XStringArray< char32 > Utf32StringArray
MapAssigner(std::map< _KTy, _VTy > *m)
MixedError(int errType, AnsiString const &errStr)
$c(std::initializer_list< std::pair< Mixed, Mixed > > list)
#define WINUX_FUNC_DECL(ret)
void append(_PodType const (&data)[_Count])
添加数据:POD类型数组
void append(AnsiString const &data)
添加数据:AnsiString对象
virtual char const * what() const
unsigned __int64 ulonglong
MapAssigner & operator()(_KTy const &k, _VTy const &v)
std::vector< _Ty > ToArray(_Ty *arr, uint count)
将C数组转换成vector
void append(Buffer const &data)
添加数据:Buffer对象
void setBuf(void const *buf, size_t size, bool isPeek)
设置缓冲区,当isPeek为false时拷贝数据缓冲区
UnicodeString toUnicode() const
转换到UnicodeString
XStringArray< wchar > UnicodeStringArray
Error(int errType, AnsiString const &errStr)
XString< char16 > UnicodeString16
virtual int getErrType() const
size_t getCapacity() const
获取容量大小
XStringArray< char32 > UnicodeString32Array
static FuncTraits< _PfnType >::ReturnType func(_ArgType &&...arg)
void append(std::initializer_list< _PodType > list)
添加数据:POD类型initializer_list
static constexpr _Ty InvertByteOrder(_Ty v)
反转字节序
std::initializer_list< Mixed > _list
std::basic_string< _ChTy > XString
RefParam< _Ty > Ref(_Ty &r)
向模板参数传递引用型参数
std::pair< String, String > StringStringPair
XStringArray< tchar > StringArray
size_t size() const
获取数据大小
XString< char16 > Utf16String
winux::byte const * end() const
ArrayAssigner(std::vector< _Ty > *a)