11 #ifndef encodingImplHelpers_H_
12 #define encodingImplHelpers_H_
21 #define is_bigendian() ( (*(char*)&endianChecker) == 0 )
27 for(
int i = 0; i < ( theSize >> 1 ); ++i )
29 theEnd = ( theSize - 1 ) - i;
30 byteArray[ i ] ^= byteArray[ theEnd ];
31 byteArray[ theEnd ] ^= byteArray[ i ];
32 byteArray[ i ] ^= byteArray[ theEnd ];
39 unsigned short msbyte = rhs & 0x00ff;
40 unsigned short lsbyte = ( rhs & 0xff00 ) >> 8;
41 return ( msbyte << 8 ) | lsbyte;
49 return ( msword << 16 ) | lsword;
56 unsigned int mspart =
endianSwap32Bit( static_cast<unsigned int>(rhs & 0xffffffff) );
57 unsigned int lspart =
endianSwap32Bit(static_cast<unsigned int>(( rhs >> 32 ) & 0xffffffff) );
58 return (
Integer64( mspart ) << 32 ) | lspart;
92 inline void appendBytes( std::vector<Octet>& wrapper,
const char* bytes,
size_t length )
96 unsigned int currentBufferSize = wrapper.size();
97 wrapper.resize( currentBufferSize + length );
98 memcpy( &wrapper[ currentBufferSize ], bytes, length );
102 inline unsigned int paddingSizeInBytes(
unsigned int bufferLength,
unsigned int elementOctetBoundary )
104 if ( bufferLength == 0 )
return 0;
105 return bufferLength % elementOctetBoundary;
109 inline void insertBytes( std::vector<Octet>& wrapper,
size_t length )
113 unsigned int currentBufferSize = wrapper.size();
114 wrapper.resize( currentBufferSize + length );