include/pantheios/inserters/fmt.hpp

Go to the documentation of this file.
00001 /* /////////////////////////////////////////////////////////////////////////
00002  * File:        pantheios/inserters/fmt.hpp
00003  *
00004  * Purpose:     Format constants for Pantheios inserter classes.
00005  *
00006  * Created:     21st June 2005
00007  * Updated:     2nd September 2006
00008  *
00009  * Author:      Matthew Wilson
00010  *
00011  * Home:        http://www.pantheios.org/
00012  *
00013  * Copyright:   Matthew Wilson and Synesis Software Pty Ltd, 1999-2005.
00014  *              Matthew Wilson, 2005-2006.
00015  *
00016  * Redistribution and use in source and binary forms, with or without
00017  * modification, are permitted provided that the following conditions are met:
00018  *
00019  * - Redistributions of source code must retain the above copyright notice, this
00020  *   list of conditions and the following disclaimer.
00021  * - Redistributions in binary form must reproduce the above copyright notice,
00022  *   this list of conditions and the following disclaimer in the documentation
00023  *   and/or other materials provided with the distribution.
00024  * - Neither the names of Matthew Wilson and Synesis Software nor the names of
00025  *   any contributors may be used to endorse or promote products derived from
00026  *   this software without specific prior written permission.
00027  *
00028  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00029  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00032  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00033  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00034  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00035  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00036  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00037  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00038  * POSSIBILITY OF SUCH DAMAGE.
00039  *
00040  * ////////////////////////////////////////////////////////////////////// */
00041 
00042 
00048 #ifndef PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_FMT
00049 #define PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_FMT
00050 
00051 /* /////////////////////////////////////////////////////////////////////////
00052  * Version information
00053  */
00054 
00055 #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
00056 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_FMT_MAJOR    2
00057 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_FMT_MINOR    0
00058 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_FMT_REVISION 8
00059 # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_FMT_EDIT     8
00060 #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
00061 
00062 /* /////////////////////////////////////////////////////////////////////////
00063  * Includes
00064  */
00065 
00066 #include <pantheios/pantheios.h>
00067 
00068 #include <stlsoft/stlsoft.h>
00069 
00070 #include <stdio.h>
00071 
00072 /* /////////////////////////////////////////////////////////////////////////
00073  * Namespace
00074  */
00075 
00076 #if !defined(PANTHEIOS_NO_NAMESPACE)
00077 namespace pantheios
00078 {
00079 
00080 #endif /* !PANTHEIOS_NO_NAMESPACE */
00081 
00082 /* /////////////////////////////////////////////////////////////////////////
00083  * Compiler / standards compatibility
00084  */
00085 
00086 #if defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION)
00087 #  define panthieos_inserter_snprintf_      ::snprintf
00088 #elif defined(STLSOFT_COMPILER_IS_MSVC) && \
00089             _MSC_VER >= 1400
00090 # define panthieos_inserter_snprintf_       ::sprintf_s
00091 #else /* ? "safe functions" */
00092 # if defined(STLSOFT_COMPILER_IS_DMC) || \
00093     (   defined(STLSOFT_COMPILER_IS_COMO) && \
00094         defined(_MSC_VER) && \
00095         defined(WIN32)) || \
00096     (   defined(STLSOFT_COMPILER_IS_INTEL) && \
00097         defined(WIN32)) || \
00098     defined(STLSOFT_COMPILER_IS_MSVC)
00099 # if defined(PANTHEIOS_MIN_CRT)
00100 extern "C" size_t panthieos_inserter_snprintf_(char *, size_t, const char *, ...);
00101 # else /* ? PANTHEIOS_MIN_CRT */
00102 #   define panthieos_inserter_snprintf_     ::_snprintf
00103 # endif /* PANTHEIOS_MIN_CRT */
00104 # else /* ? compiler */
00105 #  define panthieos_inserter_snprintf_      ::snprintf
00106 # endif /* compiler */
00107 #endif /* "safe functions" */
00108 
00109 /* /////////////////////////////////////////////////////////////////////////
00110  * Enumerations
00111  */
00112 
00128 struct fmt
00129 {
00130     enum
00131     {
00132             zeroXPrefix =   0x0100  
00133         ,   zeroPad     =   0x0200  
00134         ,   zeroPadded  =   zeroPad 
00135         ,   hex         =   0x0400  
00136         ,   fullHex     =   zeroXPrefix | zeroPad | hex  
00137     };
00138 }; // namespace fmt
00139 
00140 /* /////////////////////////////////////////////////////////////////////////
00141  * Namespace
00142  */
00143 
00144 #if !defined(PANTHEIOS_NO_NAMESPACE)
00145 } /* namespace pantheios */
00146 #endif /* !PANTHEIOS_NO_NAMESPACE */
00147 
00148 /* /////////////////////////////////////////////////////////////////////////
00149  * Inclusion
00150  */
00151 
00152 #ifdef STLSOFT_CF_PRAGMA_ONCE_SUPPORT
00153 # pragma once
00154 #endif /* STLSOFT_CF_PRAGMA_ONCE_SUPPORT */
00155 
00156 /* ////////////////////////////////////////////////////////////////////// */
00157 
00158 #endif /* !PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_FMT */
00159 
00160 /* ////////////////////////////////////////////////////////////////////// */

pantheios Library documentation © Matthew Wilson, 2006 SourceForge.net Logo