CrossFramework Library
|
00001 00006 #if defined(XBASE_INCLUDED_CHARTRAITS_HPP) 00007 #else 00008 #define XBASE_INCLUDED_CHARTRAITS_HPP 00009 00010 //------------------------------------------------------------ 00011 #include <cstdarg> 00012 #include <XBase/Bool.hpp> 00013 #include <XBase/BuiltInTypes.hpp> 00014 00015 //------------------------------------------------------------ 00016 namespace XBase { 00018 00019 00028 template< typename CharType > 00029 struct StringTraits 00030 { 00032 struct WriteResult 00033 { 00034 BoolPOD32 isSuccess; 00035 pword_t length; 00036 }; 00037 00042 static pword_t Length( const CharType* aStr ); 00043 00052 static const WriteResult NCopyStrict( CharType* aBuffer , pword_t aBufferLength , const CharType* aStr ); 00053 00064 static const WriteResult NCopy( CharType* aBuffer , pword_t aBufferLength , const CharType* aStr ); 00065 00074 static const WriteResult SNPrintfStrict( CharType* aBuffer , pword_t aBufferLength , const CharType* aFormat , ... ); 00075 00086 static const WriteResult SNPrintf( CharType* aBuffer , pword_t aBufferLength , const CharType* aFormat , ... ); 00087 00097 static const WriteResult VSNPrintfStrict( CharType* aBuffer , pword_t aBufferLength , const CharType* aFormat , va_list aArg ); 00098 00110 static const WriteResult VSNPrintf( CharType* aBuffer , pword_t aBufferLength , const CharType* aFormat , va_list aArg ); 00111 }; 00113 } 00114 //------------------------------------------------------------ 00115 #endif 00116 // EOF