00001 // $Id: PXXUnpackerUtil.h 7166 2005-05-02 05:09:28Z hoshina $ 00002 #ifndef __PXXUnpackerUtil__H__ 00003 #define __PXXUnpackerUtil__H__ 00004 00013 00014 #include "payloads-unpacker/base/PXXObject.h" 00015 00016 class PXXUnpackerUtil : public PXXObject { 00017 00018 public: 00019 00020 SET_LOGGER("PXXObject"); 00021 00025 virtual ~PXXUnpackerUtil() {} 00026 //------------------------------------------------------------------------------ 00027 00033 static Bool8b_t IsBigEndianMachine(); 00034 //------------------------------------------------------------------------------ 00035 00040 static void ByteSwap(Short16b_t &t_short); 00041 static void ByteSwap(Int32b_t &t_int); 00042 static void ByteSwap(Long64b_t &t_long); 00043 static void ByteSwap(Float32b_t &t_float); 00044 static void ByteSwap(Double64b_t &t_double); 00045 //------------------------------------------------------------------------------ 00046 00047 protected: 00048 00052 PXXUnpackerUtil(): PXXObject() {} 00053 //------------------------------------------------------------------------------ 00054 00055 public: 00056 00060 static const Int32b_t kCharSize_ ; // size of char (byte) 00061 static const Int32b_t kShortSize_; // size of short (byte) 00062 static const Int32b_t kIntSize_; // size of int (byte) 00063 static const Int32b_t kLongSize_; // size of long (byte) 00064 static const Int32b_t kFloatSize_; // size of float (byte) 00065 static const Int32b_t kDoubleSize_; // size of double(byte) 00066 00067 private: 00068 00069 static Int32b_t fIsBigEndianMachine_ ; //1:BIG_ENDIAN, 0:LITTLE_ENDIAN, -1:UNDEF 00070 00071 ClassDef(PXXUnpackerUtil, 0) // abstract base class for decoder 00072 00073 }; 00074 00075 #endif