Rev 1675 | Rev 1939 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1675 | Rev 1914 | ||
|---|---|---|---|
| Line 37... | Line 37... | ||
| 37 | 37 | ||
| 38 | typedef boost::shared_ptr<unsigned char> BytePointer; |
38 | typedef boost::shared_ptr<unsigned char> BytePointer; |
| 39 | typedef std::vector<std::string> StringList; |
39 | typedef std::vector<std::string> StringList; |
| 40 | typedef std::map<std::string, std::string> StringMap; |
40 | typedef std::map<std::string, std::string> StringMap; |
| 41 | 41 | ||
| 42 | #define SWAP_BYTE_ORDER_16(x) ((( |
42 | #define SWAP_BYTE_ORDER_16(x) ((((x) << 8) | ((x) >> 8)) & 0xFFFF) |
| 43 | #define GET_HIGH_BYTE_16(x) ((x >> 8) & 0xFF); |
43 | #define GET_HIGH_BYTE_16(x) (((x) >> 8) & 0xFF); |
| 44 | #define GET_LOW_BYTE_16(x) (x & 0xFF) |
44 | #define GET_LOW_BYTE_16(x) ((x) & 0xFF) |
| 45 | 45 | ||
| 46 | template <typename ElemT> |
46 | template <typename ElemT> |
| 47 | struct HexTo { |
47 | struct HexTo { |
| 48 | ElemT value; |
48 | ElemT value; |
| 49 | operator ElemT() const {return value;} |
49 | operator ElemT() const {return value;} |
| Line 54... | Line 54... | ||
| 54 | }; |
54 | }; |
| 55 | 55 | ||
| 56 | std::string PadNumber(unsigned int number, unsigned int length); |
56 | std::string PadNumber(unsigned int number, unsigned int length); |
| 57 | unsigned int FromHex(std::string hex_chars); |
57 | unsigned int FromHex(std::string hex_chars); |
| 58 | std::string ToHex(unsigned int value); |
58 | std::string ToHex(unsigned int value); |
| - | 59 | std::string ToHex8bit(unsigned int value); |
|
| 59 | 60 | std::string ToHex4bit(unsigned int value); |
|
| 60 | }; // namespace type |
61 | }; // namespace type |
| 61 | }; // namespace atom |
62 | }; // namespace atom |
| 62 | 63 | ||
| 63 | #endif // TYPE_COMMON_H |
64 | #endif // TYPE_COMMON_H |
| 64 | 65 | ||