fastdo  0.5.12
utilities.hpp 文件参考
#include "system_detection.inl"
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <tuple>
#include <queue>
#include <functional>
#include <algorithm>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "func_traits.inl"
#include "func_runable.inl"
#include "func_invoker.inl"
#include "mixed_ref_specified_type.inl"
utilities.hpp 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

struct  winux::Bin0< n >
 二进制数,编译时计算, 0开头(基于8进制) 更多...
 
struct  winux::Bin0< 0 >
 
class  winux::RefParam< _Ty >
 
struct  winux::IndexSequence< _Index >
 Tuple参数序列 更多...
 
struct  winux::MakeIndexSequence< _Num, _IdxSeq >
 
struct  winux::MakeIndexSequence< _Num, IndexSequence< _Index... > >
 
struct  winux::MakeIndexSequence< 0, IndexSequence< _Index... > >
 
struct  winux::FuncWrapper< _PfnType, pfn >
 函数特征 更多...
 
class  winux::MapAssigner< _KTy, _VTy >
 MAP赋值器 更多...
 
class  winux::ArrayAssigner< _Ty >
 Array赋值器 更多...
 
class  winux::MembersWrapper< _TargetCls >
 成员包装 更多...
 
class  winux::Error
 错误类 更多...
 
class  winux::Buffer
 缓冲区,表示内存中一块2进制数据(利用malloc/realloc进行内存分配) 更多...
 
class  winux::GrowBuffer
 高效的可增长缓冲区,1.33倍冗余量 更多...
 
class  winux::MixedError
 混合体错误 更多...
 
class  winux::Mixed
 混合体,能表示多种类型的值 更多...
 
class  winux::Mixed::MixedLess
 
class  winux::Mixed::CollectionAssigner
 
class  winux::Mixed::ArrayAssigner
 

命名空间

 winux
 跨平台基础功能库
 

宏定义

#define WINUX_DLL
 
#define WINUX_API
 
#define WINUX_FUNC_DECL(ret)   WINUX_DLL ret WINUX_API
 
#define WINUX_FUNC_IMPL(ret)   ret WINUX_API
 
#define countof(arr)   ( sizeof(arr) / sizeof(arr[0]) )
 
#define TEXT(__x)   __x
 
#define DISABLE_OBJECT_COPY(clsname)
 
#define CBufferToAnsiString(buf, size)   winux::AnsiString( (char const *)(buf), (size_t)(size) )
 
#define IF_PTR(ptr)   if ( (ptr) != NULL ) (ptr)
 
#define ASSIGN_PTR(ptr)   if ( (ptr) != NULL ) (*(ptr))
 
#define UNUSED(s)
 
#define DEFINE_ATTR_MEMBER(ty, name, memname)
 
#define DEFINE_ATTR_MEMBER_READONLY(ty, name, memname)
 
#define DEFINE_ATTR(ty, name, getcode, setcode)
 
#define DEFINE_ATTR_READONLY(ty, name, getcode)
 
#define GCC_VERSION_GREAT_THAN(Major, Minor, Patchlevel)   ( __GNUC__ > Major || ( __GNUC__ == Major && ( __GNUC_MINOR__ > Minor || ( __GNUC_MINOR__ == Minor && __GNUC_PATCHLEVEL__ > Patchlevel ) ) ) )
 
#define BinVal(x)   winux::Bin0<0##x>::val
 
#define MixedType_ENUM_ITEM(item)   item,
 
#define MixedType_ENUM_ITEMSTRING(item)   #item,
 
#define MixedType_ENUM_ITEMLIST(_)
 

类型定义

typedef int winux::int32
 
typedef unsigned int winux::uint
 
typedef unsigned int winux::uint32
 
typedef unsigned long winux::ulong
 
typedef short winux::int16
 
typedef unsigned short winux::ushort
 
typedef unsigned short winux::uint16
 
typedef char winux::int8
 
typedef unsigned char winux::uint8
 
typedef char16_t winux::char16
 
typedef char32_t winux::char32
 
typedef wchar_t winux::wchar
 
typedef unsigned long long winux::uint64
 
typedef unsigned long long winux::ulonglong
 
typedef long long winux::int64
 
typedef long long winux::longlong
 
typedef char winux::tchar
 
typedef unsigned char winux::byte
 
typedef std::basic_string< tchar > winux::String
 
typedef std::basic_string< char > winux::AnsiString
 
typedef AnsiString winux::LocalString
 
typedef std::basic_string< wchar > winux::UnicodeString
 
typedef std::basic_string< char16 > winux::UnicodeString16
 
typedef std::basic_string< char32 > winux::UnicodeString32
 
typedef std::vector< String > winux::StringArray
 
typedef std::map< String, String > winux::StringStringMap
 
typedef std::pair< String, String > winux::StringStringPair
 
typedef std::vector< Mixed > winux::MixedArray
 
typedef std::map< String, Mixed > winux::StringMixedMap
 
typedef std::pair< String, Mixed > winux::StringMixedPair
 

函数

template<typename _MAP , typename _KEY >
bool winux::isset (_MAP const &m, _KEY const &k)
 检测map中是否有该键的值 更多...
 
template<typename _Ty >
std::vector< _Ty > winux::ToArray (_Ty *arr, uint count)
 将C数组转换成vector 更多...
 
template<typename _Ty , uint _N>
std::vector< _Ty > winux::ToArray (_Ty(&arr)[_N])
 
template<typename _Fx , typename... _ArgType>
int winux::VoidReturnInt (_Fx fn, _ArgType &&...arg)
 调用一个返回void的函数或函数对象,返回一个数字 更多...
 
template<typename _Ty >
RefParam< _Ty > winux::Ref (_Ty &r)
 向模板参数传递引用型参数 更多...
 
template<typename _KTy , typename _VTy >
MapAssigner< _KTy, _VTy > winux::Assign (std::map< _KTy, _VTy > *m)
 给容器赋值 更多...
 
template<typename _Ty >
ArrayAssigner< _Ty > winux::Assign (std::vector< _Ty > *a)
 给容器赋值 更多...
 
bool winux::ValueIsInArray (StringArray const &arr, String const &val, bool caseInsensitive=false)
 判断一个字符串值是否在一个字符串数组里,默认大小写敏感 更多...
 
int winux::Random (int n1, int n2)
 随机数,随机产生n1~n2的数字. 包括n1,n2本身 更多...
 
std::ostream & winux::operator<< (std::ostream &o, Mixed const &m)
 扩展iostream的<< 更多...
 
std::wostream & winux::operator<< (std::wostream &o, Mixed const &m)
 

宏定义说明

#define ASSIGN_PTR (   ptr)    if ( (ptr) != NULL ) (*(ptr))

在文件 utilities.hpp89 行定义.

#define BinVal (   x)    winux::Bin0<0##x>::val

在文件 utilities.hpp224 行定义.

#define CBufferToAnsiString (   buf,
  size 
)    winux::AnsiString( (char const *)(buf), (size_t)(size) )

在文件 utilities.hpp83 行定义.

#define countof (   arr)    ( sizeof(arr) / sizeof(arr[0]) )

在文件 utilities.hpp65 行定义.

#define DEFINE_ATTR (   ty,
  name,
  getcode,
  setcode 
)
值:
public:\
ty get##name() const { getcode; }\
void set##name( ty const & _VAL_ ) { setcode; }

在文件 utilities.hpp111 行定义.

#define DEFINE_ATTR_MEMBER (   ty,
  name,
  memname 
)
值:
public:\
ty const & get##name() const { return this->##memname; }\
void set##name( ty const & v ) { this->##memname = v; }\
private:\
ty memname;

在文件 utilities.hpp96 行定义.

#define DEFINE_ATTR_MEMBER_READONLY (   ty,
  name,
  memname 
)
值:
public:\
ty const & get##name() const { return this->##memname; }\
private:\
ty memname;

在文件 utilities.hpp104 行定义.

#define DEFINE_ATTR_READONLY (   ty,
  name,
  getcode 
)
值:
public:\
ty get##name() const { getcode; }

在文件 utilities.hpp117 行定义.

#define DISABLE_OBJECT_COPY (   clsname)
值:
private:\
clsname & operator = ( clsname const & ) = delete;\
clsname( clsname const & ) = delete;

在文件 utilities.hpp78 行定义.

#define GCC_VERSION_GREAT_THAN (   Major,
  Minor,
  Patchlevel 
)    ( __GNUC__ > Major || ( __GNUC__ == Major && ( __GNUC_MINOR__ > Minor || ( __GNUC_MINOR__ == Minor && __GNUC_PATCHLEVEL__ > Patchlevel ) ) ) )

在文件 utilities.hpp123 行定义.

#define IF_PTR (   ptr)    if ( (ptr) != NULL ) (ptr)

在文件 utilities.hpp87 行定义.

#define MixedType_ENUM_ITEM (   item)    item,

在文件 utilities.hpp591 行定义.

#define MixedType_ENUM_ITEMLIST (   _)
值:
_(MT_NULL)\
_(MT_BOOLEAN)\
_(MT_BYTE)\
_(MT_SHORT) _(MT_USHORT)\
_(MT_INT) _(MT_UINT)\
_(MT_LONG) _(MT_ULONG)\
_(MT_INT64) _(MT_UINT64)\
_(MT_FLOAT) _(MT_DOUBLE)\
_(MT_ANSI) _(MT_UNICODE)\
_(MT_ARRAY) \
_(MT_COLLECTION) \
_(MT_BINARY)

二进制数据类型,利用Buffer类对象存储的二进制数据

在文件 utilities.hpp593 行定义.

#define MixedType_ENUM_ITEMSTRING (   item)    #item,

在文件 utilities.hpp592 行定义.

#define TEXT (   __x)    __x

在文件 utilities.hpp72 行定义.

#define UNUSED (   s)

在文件 utilities.hpp93 行定义.

#define WINUX_API

在文件 utilities.hpp58 行定义.

#define WINUX_DLL

在文件 utilities.hpp57 行定义.

#define WINUX_FUNC_DECL (   ret)    WINUX_DLL ret WINUX_API

在文件 utilities.hpp61 行定义.

#define WINUX_FUNC_IMPL (   ret)    ret WINUX_API

在文件 utilities.hpp62 行定义.