⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stlsoft.h

📁 用STL的方式封装了WindowsAPI、COM调用、ACE、ATL、MFC、WTL等多种组件
💻 H
📖 第 1 页 / 共 5 页
字号:
typedef ss_ptrdiff_pr_t_    ss_ptrdiff_t;       /*!< \brief ptr diff                */
typedef long                ss_streampos_t;     /*!< \brief streampos               */
typedef long                ss_streamoff_t;     /*!< \brief streamoff               */

#ifndef _STLSOFT_NO_NAMESPACE
typedef ss_char_a_t         char_a_t;           /*!< \brief Ansi char type          */
typedef ss_char_w_t         char_w_t;           /*!< \brief Unicode char type       */
typedef ss_int8_t           int8_t;             /*!< \brief 8-bit integer           */
typedef ss_sint8_t          sint8_t;            /*!< \brief 8-bit signed integer    */
typedef ss_uint8_t          uint8_t;            /*!< \brief 8-bit unsigned integer  */
typedef ss_int16_t          int16_t;            /*!< \brief 16-bit integer          */
typedef ss_sint16_t         sint16_t;           /*!< \brief 16-bit signed integer   */
typedef ss_uint16_t         uint16_t;           /*!< \brief 16-bit unsigned integer */
typedef ss_int32_t          int32_t;            /*!< \brief 32-bit integer          */
typedef ss_sint32_t         sint32_t;           /*!< \brief 32-bit signed integer   */
typedef ss_uint32_t         uint32_t;           /*!< \brief 32-bit unsigned integer */
# ifdef STLSOFT_CF_64BIT_INT_SUPPORT
typedef ss_int64_t          int64_t;            /*!< \brief 64-bit integer          */
typedef ss_sint64_t         sint64_t;           /*!< \brief 64-bit signed integer   */
typedef ss_uint64_t         uint64_t;           /*!< \brief 64-bit unsigned integer */
# endif /* STLSOFT_CF_64BIT_INT_SUPPORT */
typedef ss_short_t          short_t;            /*!< \brief short integer           */
typedef ss_int_t            int_t;              /*!< \brief integer                 */
typedef ss_sint_t           sint_t;             /*!< \brief signed integer          */
typedef ss_uint_t           uint_t;             /*!< \brief unsigned integer        */
typedef ss_long_t           long_t;             /*!< \brief long integer            */
typedef ss_byte_t           byte_t;             /*!< \brief Byte                    */
#if defined(__cplusplus)
typedef ss_bool_t           bool_t;             /*!< \brief bool                    */
#endif /* __cplusplus */
# if !defined(STLSOFT_COMPILER_IS_DMC)
typedef ss_size_t           size_t;             /*!< \brief size                    */
typedef ss_ptrdiff_t        ptrdiff_t;          /*!< \brief ptr diff                */
typedef ss_streampos_t      streampos_t;        /*!< \brief streampos               */
typedef ss_streamoff_t      streamoff_t;        /*!< \brief streamoff               */
# endif /* compiler */
#endif /* !_STLSOFT_NO_NAMESPACE */


#if 0
template <ss_size_t N>
struct uintp_traits;

STLSOFT_GEN_TRAIT_SPECIALISATION
struct uintp_traits<1>
{
    typedef uint8_t     unsigned_type;
}

typedef size_traits<sizeof(void*)>::signed_type     sintp_t;
typedef size_traits<sizeof(void*)>::unsigned_type   uintp_t;

#endif /* 0 */



#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# if defined(__cplusplus)
struct stlsoft_size_checker
{
#  ifdef STLSOFT_COMPILER_IS_GCC
protected: /* GCC is too "helpful" in this case, so must declare as protected */
#  else /* ? compiler */
private:
#  endif /* compiler */
    stlsoft_size_checker();
    ~stlsoft_size_checker()
    {
        /* Char types */
        STLSOFT_STATIC_ASSERT(sizeof(ss_char_a_t) >= 1);
        STLSOFT_STATIC_ASSERT(sizeof(ss_char_w_t) >= 2);
        /* 8-bit types */
        STLSOFT_STATIC_ASSERT(sizeof(ss_int8_t)   == 1);
        STLSOFT_STATIC_ASSERT(sizeof(ss_sint8_t)  == sizeof(ss_int8_t));
        STLSOFT_STATIC_ASSERT(sizeof(ss_uint8_t)  == sizeof(ss_int8_t));
        /* 16-bit types */
        STLSOFT_STATIC_ASSERT(sizeof(ss_int16_t)  == 2);
        STLSOFT_STATIC_ASSERT(sizeof(ss_sint16_t) == sizeof(ss_int16_t));
        STLSOFT_STATIC_ASSERT(sizeof(ss_uint16_t) == sizeof(ss_int16_t));
        /* 32-bit types */
        STLSOFT_STATIC_ASSERT(sizeof(ss_int32_t)  == 4);
        STLSOFT_STATIC_ASSERT(sizeof(ss_sint32_t) == sizeof(ss_int32_t));
        STLSOFT_STATIC_ASSERT(sizeof(ss_uint32_t) == sizeof(ss_int32_t));
        /* 64-bit types */
#  ifdef STLSOFT_CF_64BIT_INT_SUPPORT
        STLSOFT_STATIC_ASSERT(sizeof(ss_int64_t)  == 8);
        STLSOFT_STATIC_ASSERT(sizeof(ss_sint64_t) == sizeof(ss_int64_t));
        STLSOFT_STATIC_ASSERT(sizeof(ss_uint64_t) == sizeof(ss_int64_t));
#  endif /* STLSOFT_CF_64BIT_INT_SUPPORT */
        /* Integer types */
        STLSOFT_STATIC_ASSERT(sizeof(ss_int_t)    >= 1);
        STLSOFT_STATIC_ASSERT(sizeof(ss_sint_t)   == sizeof(ss_int_t));
        STLSOFT_STATIC_ASSERT(sizeof(ss_uint_t)   == sizeof(ss_int_t));
        STLSOFT_STATIC_ASSERT(sizeof(ss_long_t)   >= sizeof(ss_int_t));
        /* byte type */
        STLSOFT_STATIC_ASSERT(sizeof(ss_byte_t)   == 1);
        /* Boolean type */
        STLSOFT_STATIC_ASSERT(sizeof(ss_bool_t)   >= 1);
        /* Other types */
        STLSOFT_STATIC_ASSERT(sizeof(ss_size_t)   >= 1);
        STLSOFT_STATIC_ASSERT(sizeof(ss_ptrdiff_t) >= 1);
        STLSOFT_STATIC_ASSERT(sizeof(ss_streampos_t) >= 1);
        STLSOFT_STATIC_ASSERT(sizeof(ss_streamoff_t) >= 1);
    }
};
# endif /* __cplusplus */
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */

/* /////////////////////////////////////////////////////////////////////////
 * Keywords
 *
 * The STLSoft uses a number of preprocessor symbols to aid in compiler
 * compatibility in the libraries' code.
 *
 * ss_explicit_k            -   explicit, or nothing
 * ss_mutable_k             -   mutable, or nothing
 * ss_typename_type_k       -   typename, or nothing (used within template
 *                              definitions for declaring types derived from
 *                              externally derived types)
 * ss_typename_param_k      -   typename or class (used for template parameters)
 * ss_typename_type_def_k   -   typename qualifier in template default parameters
 * ss_typename_type_mil_k   -   typename qualifier in constructor initialiser lists
 */

/** \defgroup pseudo_keyword_macros Pseudo-keyword Macros
 * \ingroup group__project__stlsoft
 * \brief These macros are used to handle difference in support of certain keywords between translators
 * @{
 */

/** \def ss_explicit_k
 *
 * \brief Evaluates to <b>explicit</b> on translators that support the keyword, otherwise to nothing
 */
#ifdef STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT
# define ss_explicit_k              explicit
#else /* ? STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT */
# define ss_explicit_k
#endif /* STLSOFT_CF_EXPLICIT_KEYWORD_SUPPORT */

/** \def ss_mutable_k
 *
 * \brief Evaluates to <b>mutable</b> on translators that support the keyword, otherwise to nothing
 */
#ifdef STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT
# define ss_mutable_k               mutable
#else /* ? STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT */
# define ss_mutable_k
#endif /* STLSOFT_CF_MUTABLE_KEYWORD_SUPPORT */

/** \def ss_typename_param_k
 *
 * \brief Evaluates to <b>typename</b> on translators that support the keyword, otherwise to <b>class</b>
 *
 * Used for template parameter declarations
 */
#ifdef STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT
# define ss_typename_param_k        typename
#else /* ? STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT */
# define ss_typename_param_k        class
#endif /* STLSOFT_CF_TYPENAME_PARAM_KEYWORD_SUPPORT */

/** \def ss_typename_type_k
 *
 * \brief Evaluates to <b>typename</b> on translators that support the keyword, otherwise to nothing
 *
 * Used for type disambiguation inside template bodies
 */
#ifdef STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT
# define ss_typename_type_k         typename
#else /* ? STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT */
# define ss_typename_type_k
#endif /* STLSOFT_CF_TYPENAME_TYPE_KEYWORD_SUPPORT */

/** \def ss_typename_type_def_k
 *
 * \brief Evaluates to <b>typename</b> on translators that support the keyword, otherwise to nothing
 *
 * Used for type disambiguation in default template arguments
 */
#ifdef STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT
# define ss_typename_type_def_k     typename
#else /* ? STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT */
# define ss_typename_type_def_k
#endif /* STLSOFT_CF_TYPENAME_TYPE_DEF_KEYWORD_SUPPORT */

/** \def ss_typename_type_mil_k
 *
 * \brief Evaluates to <b>typename</b> on translators that support the keyword, otherwise to nothing
 *
 * Used for type disambiguation inside initialiser lists in class template constructors
 */
#ifdef STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT
# define ss_typename_type_mil_k     typename
#else /* ? STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT */
# define ss_typename_type_mil_k
#endif /* STLSOFT_CF_TYPENAME_TYPE_MIL_KEYWORD_SUPPORT */

/** \def ss_template_qual_k
 *
 * \brief Evaluates to <b>template</b> on translators that support its use for type qualification
 */
#ifdef STLSOFT_CF_TEMPLATE_QUALIFIER_KEYWORD_SUPPORT
# define ss_template_qual_k         template
#else /* ? STLSOFT_CF_TEMPLATE_QUALIFIER_KEYWORD_SUPPORT */
# define ss_template_qual_k
#endif /* STLSOFT_CF_TEMPLATE_QUALIFIER_KEYWORD_SUPPORT */

/** @} */

/* /////////////////////////////////////////////////////////////////////////
 * Values
 *
 * Since the boolean type may not be supported natively on all compilers, the
 * values of true and false may also not be provided. Hence the values of
 * ss_true_v and ss_false_v are defined, and are used in all code.
 */

#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION

#ifdef STLSOFT_CF_NATIVE_BOOL_SUPPORT
# define ss_true_v       (true)
# define ss_false_v      (false)
#else /* ? STLSOFT_CF_NATIVE_BOOL_SUPPORT */
# define ss_true_v       (1)
# define ss_false_v      (0)
#endif /* STLSOFT_CF_NATIVE_BOOL_SUPPORT */

#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
 * Exception signature macro(s)
 */

#ifdef __cplusplus

/** \brief Throws the given exception
 *
 * \note This is needed because Visual C++ 5.0 goes into an infinite loop if
 *        the exception instance is passed to throw. The apparent workaround
 *        (which only took me six years to discover!) is to apply *& to the
 *        instance.
 */
template <ss_typename_param_k X>
inline void throw_x(X const &x)
#if defined(STLSOFT_COMPILER_IS_MSVC) && \
    _MSC_VER < 1200
{
    X const *px =   &x;

    throw *px;
}
#else /* ? compiler */
{
    throw x;
}
#endif /* compiler */

#endif /* __cplusplus */

/** \defgroup code_modification_macros Code Modification Macros
 * \ingroup group__project__stlsoft
 * \brief These macros are used to help out where compiler differences are
 * so great as to cause great disgusting messes in the class/function implementations
 * @{
 */

/** \def stlsoft_throw_0
 * \brief Indicates that the given function/method does not throw any exceptions.
 */
/** \def stlsoft_throw_1
 * \brief Indicates that the given function/method throws the named type.
 */
/** \def stlsoft_throw_2
 * \brief Indicates that the given function/method throws the named types.
 */
/** \def stlsoft_throw_3
 * \brief Indicates that the given function/method throws the named types.
 */
/** \def stlsoft_throw_4
 * \brief Indicates that the given function/method throws the named types.
 */
/** \def stlsoft_throw_5
 * \brief Indicates that the given function/method throws the named types.
 */
/** \def stlsoft_throw_6
 * \brief Indicates that the given function/method throws the named types.
 */
/** \def stlsoft_throw_7
 * \brief Indicates that the given function/method throws the named types.
 */
/** \def stlsoft_throw_8
 * \brief Indicates that the given function/method throws the named types.
 */

/* Exception signatures. */
#if !defined(STLSOFT_NO_USE_EXCEPTION_SPECIFICATIONS) && \
    !defined(STLSOFT_DOCUMENTATION_SKIP_SECTION) && \
    (   defined(STLSOFT_USE_EXCEPTION_SPECIFICATIONS) || \
        defined(STLSOFT_CF_EXCEPTION_SIGNATURE_SUPPORT))
# ifndef STLSOFT_USE_EXCEPTION_SPECIFICATIONS
#  define STLSOFT_USE_EXCEPTION_SPECIFICATIONS
# endif /* !STLSOFT_USE_EXCEPTION_SPECIFICATIONS */
# define st

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -