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

📄 mfcstl.hpp

📁 用STL的方式封装了WindowsAPI、COM调用、ACE、ATL、MFC、WTL等多种组件
💻 HPP
📖 第 1 页 / 共 2 页
字号:
 * undefined using a cascasing system, as follows:
 *
 * If _STLSOFT_NO_NAMESPACES is defined, then _MFCSTL_NO_NAMESPACES is defined.
 *
 * If _MFCSTL_NO_NAMESPACES is defined, then _MFCSTL_NO_NAMESPACE is defined.
 *
 * If _MFCSTL_NO_NAMESPACE is defined, then the MFCSTL constructs are defined
 * in the global scope.
 *
 * If _STLSOFT_NO_NAMESPACES, _MFCSTL_NO_NAMESPACES and _MFCSTL_NO_NAMESPACE are
 * all undefined but the symbol _STLSOFT_NO_NAMESPACE is defined (whence the
 * namespace stlsoft does not exist), then the MFCSTL constructs are defined
 * within the mfcstl namespace. The definition matrix is as follows:
 *
 * _STLSOFT_NO_NAMESPACE    _MFCSTL_NO_NAMESPACE    mfcstl definition
 * ---------------------    --------------------    -----------------
 *  not defined              not defined             = stlsoft::mfcstl_project
 *  not defined              defined                 not defined
 *  defined                  not defined             mfcstl
 *  defined                  defined                 not defined
 *
 *
 *
 * The macro mfcstl_ns_qual() macro can be used to refer to elements in the
 * MFCSTL libraries irrespective of whether they are in the
 * stlsoft::mfcstl_project (or mfcstl) namespace or in the global namespace.
 *
 * Furthermore, some compilers do not support the standard library in the std
 * namespace, so the mfcstl_ns_qual_std() macro can be used to refer to elements
 * in the MFCSTL libraries irrespective of whether they are in the std namespace
 * or in the global namespace.
 *
 *
 * The MFC libraries themselves may or may not be defined within the MFC
 * namespace, so the mfcstl_ns_qual_stl() macro can be used to refer to
 * elements in the MFCSTL libraries irrespective of whether they are in the std
 * namespace or in the global namespace.
 */

/* No STLSoft namespaces means no MFCSTL namespaces */
#ifdef _STLSOFT_NO_NAMESPACES
# define _MFCSTL_NO_NAMESPACES
#endif /* _STLSOFT_NO_NAMESPACES */

/* No MFCSTL namespaces means no mfcstl namespace */
#ifdef _MFCSTL_NO_NAMESPACES
# define _MFCSTL_NO_NAMESPACE
#endif /* _MFCSTL_NO_NAMESPACES */

#ifndef _MFCSTL_NO_NAMESPACE
# if defined(_STLSOFT_NO_NAMESPACE) || \
     defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
/* There is no stlsoft namespace, so must define ::mfcstl */
/** \brief The <code class="namespace">mfcstl</code> namespace contains all components
 *   in the \ref group__project__mfcstl "MFCSTL" project.
 *
 * By default, the <code>mfcstl</code> namespace is actually an alias for
 * the namespace <code>stlsoft::mfcstl_project</code>, which is where all
 * the \ref group__project__mfcstl "MFCSTL" components actually reside. This
 * measure allows all components within the main the
 * \ref group__project__stlsoft "STLSoft" project (which are defined within
 * the <code>stlsoft</code> namespace) to be visible to all components
 * "within" the <code>mfcstl</code> namespace. (Otherwise, there would be a
 * whole lot of onerous qualification throughout the code of all
 * \ref group__projects "sub-projects".)
 *
 * \note If either/both of the symbols <code>_STLSOFT_NO_NAMESPACES</code>
 * and <code>_MFCSTL_NO_NAMESPACE</code> are defined, all 
 * \ref group__project__mfcstl "MFCSTL" components will be defined in the
 * global namespace. Conversely, if the <code>_STLSOFT_NO_NAMESPACE</code>
 * symbol (not to be confused with the 
 * <code>_STLSOFT_NO_NAMESPACES</code> symbol!) is defined - meaning that
 * all \ref group__project__stlsoft "main project" components are to be
 * defined in the global namespace, and <code>_MFCSTL_NO_NAMESPACE</code>
 * is <b>not</b> defined, then all \ref group__project__mfcstl "MFCSTL"
 * components will be defined within a bona fide <code>mfcstl</code>
 * namespace.
 *
 * \note This is a vestige of compatibility with compilers with
 * no (or no sensible) namespace support that is maintained for reasons of
 * backwards compatiblity and because it is, in <i>rare circumstances</i>, a
 * useful facility.
 */
namespace mfcstl
{
# else
/* Define stlsoft::mfcstl_project */

namespace stlsoft
{

namespace mfcstl_project
{

# endif /* _STLSOFT_NO_NAMESPACE */
#else
stlsoft_ns_using(move_lhs_from_rhs)
#endif /* !_MFCSTL_NO_NAMESPACE */

/** \def mfcstl_ns_qual(x)
 * Qualifies with <b>mfcstl::</b> if MFCSTL is using namespaces or, if not, does not qualify
 */

/** \def mfcstl_ns_using(x)
 * Declares a using directive (with respect to <b>mfcstl</b>) if MFCSTL is using namespaces or, if not, does nothing
 */

#ifndef _MFCSTL_NO_NAMESPACE
# define mfcstl_ns_qual(x)          ::mfcstl::x
# define mfcstl_ns_using(x)         using ::mfcstl::x;
#else /* ? _MFCSTL_NO_NAMESPACE */
# define mfcstl_ns_qual(x)          x
# define mfcstl_ns_using(x)
#endif /* !_MFCSTL_NO_NAMESPACE */

/** \def mfcstl_ns_qual_std(x)
 * Qualifies with <b>std::</b> if MFCSTL is being translated in the context of the standard library being within the <b>std</b> namespace or, if not, does not qualify
 */

/** \def mfcstl_ns_using_std(x)
 * Declares a using directive (with respect to <b>std</b>) if MFCSTL is being translated in the context of the standard library being within the <b>std</b> namespace or, if not, does nothing
 */

#ifdef STLSOFT_CF_std_NAMESPACE
# define mfcstl_ns_qual_std(x)      ::std::x
# define mfcstl_ns_using_std(x)     using ::std::x;
#else /* ? STLSOFT_CF_std_NAMESPACE */
# define mfcstl_ns_qual_std(x)      x
# define mfcstl_ns_using_std(x)
#endif /* !STLSOFT_CF_std_NAMESPACE */

/* /////////////////////////////////////////////////////////////////////////
 * Typedefs
 *
 * The MFCSTL uses a number of typedefs to aid in compiler-independence in the
 * libraries' main code.
 */

#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION

typedef stlsoft_ns_qual(ss_char_a_t)        ms_char_a_t;    //!< Ansi char type
typedef stlsoft_ns_qual(ss_char_w_t)        ms_char_w_t;    //!< Unicode char type
typedef stlsoft_ns_qual(ss_sint8_t)         ms_sint8_t;     //!< 8-bit signed integer
typedef stlsoft_ns_qual(ss_uint8_t)         ms_uint8_t;     //!< 8-bit unsigned integer
typedef stlsoft_ns_qual(ss_int16_t)         ms_int16_t;     //!< 16-bit integer
typedef stlsoft_ns_qual(ss_sint16_t)        ms_sint16_t;    //!< 16-bit signed integer
typedef stlsoft_ns_qual(ss_uint16_t)        ms_uint16_t;    //!< 16-bit unsigned integer
typedef stlsoft_ns_qual(ss_int32_t)         ms_int32_t;     //!< 32-bit integer
typedef stlsoft_ns_qual(ss_sint32_t)        ms_sint32_t;    //!< 32-bit signed integer
typedef stlsoft_ns_qual(ss_uint32_t)        ms_uint32_t;    //!< 32-bit unsigned integer
#ifdef STLSOFT_CF_64BIT_INT_SUPPORT
typedef stlsoft_ns_qual(ss_int64_t)         ms_int64_t;     //!< 64-bit integer
typedef stlsoft_ns_qual(ss_sint64_t)        ms_sint64_t;    //!< 64-bit signed integer
typedef stlsoft_ns_qual(ss_uint64_t)        ms_uint64_t;    //!< 64-bit unsigned integer
#endif /* STLSOFT_CF_64BIT_INT_SUPPORT */
typedef stlsoft_ns_qual(ss_int_t)           ms_int_t;       //!< integer
typedef stlsoft_ns_qual(ss_sint_t)          ms_sint_t;      //!< signed integer
typedef stlsoft_ns_qual(ss_uint_t)          ms_uint_t;      //!< unsigned integer
typedef stlsoft_ns_qual(ss_long_t)          ms_long_t;      //!< long
typedef stlsoft_ns_qual(ss_bool_t)          ms_bool_t;      //!< bool
typedef DWORD                               ms_dword_t;     //!< dword
typedef stlsoft_ns_qual(ss_size_t)          ms_size_t;      //!< size
typedef stlsoft_ns_qual(ss_ptrdiff_t)       ms_ptrdiff_t;   //!< ptr diff
typedef stlsoft_ns_qual(ss_streampos_t)     ms_streampos_t; //!< streampos
typedef stlsoft_ns_qual(ss_streamoff_t)     ms_streamoff_t; //!< streamoff

#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */

/* /////////////////////////////////////////////////////////////////////////
 * 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
 * ms_true_v and ms_false_v are defined, and are used in all code.
 */

#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION

#define ms_true_v       ss_true_v
#define ms_false_v      ss_false_v

#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
 * Code modification macros
 */

#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
/* Exception signatures. */
#define mfcstl_throw_0()                                stlsoft_throw_0()
#define mfcstl_throw_1(x1)                              stlsoft_throw_1(x1)
#define mfcstl_throw_2(x1, x2)                          stlsoft_throw_2(x1, x2)
#define mfcstl_throw_3(x1, x2, x3)                      stlsoft_throw_3(x1, x2, x3)
#define mfcstl_throw_4(x1, x2, x3, x4)                  stlsoft_throw_4(x1, x2, x3, x4)
#define mfcstl_throw_5(x1, x2, x3, x4, x5)              stlsoft_throw_5(x1, x2, x3, x4, x5)
#define mfcstl_throw_6(x1, x2, x3, x4, x5, x6)          stlsoft_throw_6(x1, x2, x3, x4, x5, x6)
#define mfcstl_throw_7(x1, x2, x3, x4, x5, x6, x7)      stlsoft_throw_7(x1, x2, x3, x4, x5, x6, x7)
#define mfcstl_throw_8(x1, x2, x3, x4, x5, x6, x7, x8)  stlsoft_throw_8(x1, x2, x3, x4, x5, x6, x7, x8)
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */

/// Evaluates, at compile time, to the number of elements within the given vector entity
///
/// \param ar An array whose dimension is to be evaluated
#define MFCSTL_NUM_ELEMENTS(ar)                         STLSOFT_NUM_ELEMENTS(ar)
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define mfcstl_num_elements(ar)                        MFCSTL_NUM_ELEMENTS(ar)
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */

/** \brief [DEPRECATED] Destroys the given instance \c p of the given type (\c t and \c _type)
 *
 * \deprecated This is <b>heavily</b> deprecated in favour of \ref STLSOFT_DESTROY_INSTANCE().
 */
#define mfcstl_destroy_instance(t, _type, p)            STLSOFT_DESTROY_INSTANCE(t, _type, p)

/** \brief [DEPRECATED] Generates an opaque type with the name \c _htype
 *
 * \deprecated This is <b>heavily</b> deprecated in favour of \ref STLSOFT_GEN_OPAQUE().
 */
#define mfcstl_gen_opaque(_htype)                       STLSOFT_GEN_OPAQUE(_htype)

/* ////////////////////////////////////////////////////////////////////// */

#ifndef _MFCSTL_NO_NAMESPACE
# if defined(_STLSOFT_NO_NAMESPACE) || \
     defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
} // namespace mfcstl
# else
} // namespace mfcstl_project
} // namespace stlsoft
namespace mfcstl = ::stlsoft::mfcstl_project;
# endif /* _STLSOFT_NO_NAMESPACE */
#endif /* !_MFCSTL_NO_NAMESPACE */

/* /////////////////////////////////////////////////////////////////////////
 * Inclusion
 */

#ifdef STLSOFT_CF_PRAGMA_ONCE_SUPPORT
# pragma once
#endif /* STLSOFT_CF_PRAGMA_ONCE_SUPPORT */

/* ////////////////////////////////////////////////////////////////////// */

#endif /* MFCSTL_INCL_MFCSTL_HPP_MFCSTL */

/* ////////////////////////////////////////////////////////////////////// */

⌨️ 快捷键说明

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