00001
00002
00003 #ifndef BASE_INTTRAITS_H
00004 #define BASE_INTTRAITS_H
00005
00006 #include "portable.h"
00007
00008 namespace base {
00010 template<class intT> struct PPBASE_EXPORT IntTraits {};
00011
00013 template<> struct PPBASE_EXPORT IntTraits<char> {
00014 typedef char signed_type;
00015 typedef unsigned char unsigned_type;
00016 };
00017
00019 template<> struct PPBASE_EXPORT IntTraits<unsigned char> {
00020 typedef char signed_type;
00021 typedef unsigned char unsigned_type;
00022 };
00023
00025 template<> struct PPBASE_EXPORT IntTraits<short> {
00026 typedef short signed_type;
00027 typedef unsigned short unsigned_type;
00028 };
00029
00031 template<> struct PPBASE_EXPORT IntTraits<unsigned short> {
00032 typedef short signed_type;
00033 typedef unsigned short unsigned_type;
00034 };
00035
00037 template<> struct PPBASE_EXPORT IntTraits<int> {
00038 typedef int signed_type;
00039 typedef unsigned int unsigned_type;
00040 };
00041
00043 template<> struct PPBASE_EXPORT IntTraits<unsigned int> {
00044 typedef int signed_type;
00045 typedef unsigned int unsigned_type;
00046 };
00047
00049 template<> struct PPBASE_EXPORT IntTraits<long> {
00050 typedef long signed_type;
00051 typedef unsigned long unsigned_type;
00052 };
00053
00055 template<> struct PPBASE_EXPORT IntTraits<unsigned long> {
00056 typedef long signed_type;
00057 typedef unsigned long unsigned_type;
00058 };
00059
00061 template<> struct PPBASE_EXPORT IntTraits<longlong_t> {
00062 typedef longlong_t signed_type;
00063 typedef u_longlong_t unsigned_type;
00064 };
00065
00067 template<> struct PPBASE_EXPORT IntTraits<u_longlong_t> {
00068 typedef longlong_t signed_type;
00069 typedef u_longlong_t unsigned_type;
00070 };
00071 }
00072
00073 #endif