diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/Common/IntToString.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/CPP/Common/IntToString.h b/CPP/Common/IntToString.h index f4fc662..2f096d6 100644 --- a/CPP/Common/IntToString.h +++ b/CPP/Common/IntToString.h | |||
@@ -12,19 +12,43 @@ char * ConvertUInt64ToString(UInt64 value, char *s) throw(); | |||
12 | 12 | ||
13 | wchar_t * ConvertUInt32ToString(UInt32 value, wchar_t *s) throw(); | 13 | wchar_t * ConvertUInt32ToString(UInt32 value, wchar_t *s) throw(); |
14 | wchar_t * ConvertUInt64ToString(UInt64 value, wchar_t *s) throw(); | 14 | wchar_t * ConvertUInt64ToString(UInt64 value, wchar_t *s) throw(); |
15 | void ConvertInt64ToString(Int64 value, char *s) throw(); | ||
16 | void ConvertInt64ToString(Int64 value, wchar_t *s) throw(); | ||
15 | 17 | ||
16 | void ConvertUInt64ToOct(UInt64 value, char *s) throw(); | 18 | void ConvertUInt64ToOct(UInt64 value, char *s) throw(); |
17 | 19 | ||
20 | extern const char k_Hex_Upper[16]; | ||
21 | extern const char k_Hex_Lower[16]; | ||
22 | |||
23 | #define GET_HEX_CHAR_UPPER(t) (k_Hex_Upper[t]) | ||
24 | #define GET_HEX_CHAR_LOWER(t) (k_Hex_Lower[t]) | ||
25 | /* | ||
26 | // #define GET_HEX_CHAR_UPPER(t) ((char)(((t < 10) ? ('0' + t) : ('A' + (t - 10))))) | ||
27 | static inline unsigned GetHex_Lower(unsigned v) | ||
28 | { | ||
29 | const unsigned v0 = v + '0'; | ||
30 | v += 'a' - 10; | ||
31 | if (v < 'a') | ||
32 | v = v0; | ||
33 | return v; | ||
34 | } | ||
35 | static inline char GetHex_Upper(unsigned v) | ||
36 | { | ||
37 | return (char)((v < 10) ? ('0' + v) : ('A' + (v - 10))); | ||
38 | } | ||
39 | */ | ||
40 | |||
41 | |||
18 | void ConvertUInt32ToHex(UInt32 value, char *s) throw(); | 42 | void ConvertUInt32ToHex(UInt32 value, char *s) throw(); |
19 | void ConvertUInt64ToHex(UInt64 value, char *s) throw(); | 43 | void ConvertUInt64ToHex(UInt64 value, char *s) throw(); |
20 | void ConvertUInt32ToHex8Digits(UInt32 value, char *s) throw(); | 44 | void ConvertUInt32ToHex8Digits(UInt32 value, char *s) throw(); |
21 | // void ConvertUInt32ToHex8Digits(UInt32 value, wchar_t *s) throw(); | 45 | // void ConvertUInt32ToHex8Digits(UInt32 value, wchar_t *s) throw(); |
22 | 46 | ||
23 | void ConvertInt64ToString(Int64 value, char *s) throw(); | ||
24 | void ConvertInt64ToString(Int64 value, wchar_t *s) throw(); | ||
25 | |||
26 | // use RawLeGuid only for RAW bytes that contain stored GUID as Little-endian. | 47 | // use RawLeGuid only for RAW bytes that contain stored GUID as Little-endian. |
27 | char *RawLeGuidToString(const Byte *guid, char *s) throw(); | 48 | char *RawLeGuidToString(const Byte *guid, char *s) throw(); |
28 | char *RawLeGuidToString_Braced(const Byte *guid, char *s) throw(); | 49 | char *RawLeGuidToString_Braced(const Byte *guid, char *s) throw(); |
29 | 50 | ||
51 | void ConvertDataToHex_Lower(char *dest, const Byte *src, size_t size) throw(); | ||
52 | void ConvertDataToHex_Upper(char *dest, const Byte *src, size_t size) throw(); | ||
53 | |||
30 | #endif | 54 | #endif |