aboutsummaryrefslogtreecommitdiff
path: root/CPP/Common/IntToString.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--CPP/Common/IntToString.h30
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
13wchar_t * ConvertUInt32ToString(UInt32 value, wchar_t *s) throw(); 13wchar_t * ConvertUInt32ToString(UInt32 value, wchar_t *s) throw();
14wchar_t * ConvertUInt64ToString(UInt64 value, wchar_t *s) throw(); 14wchar_t * ConvertUInt64ToString(UInt64 value, wchar_t *s) throw();
15void ConvertInt64ToString(Int64 value, char *s) throw();
16void ConvertInt64ToString(Int64 value, wchar_t *s) throw();
15 17
16void ConvertUInt64ToOct(UInt64 value, char *s) throw(); 18void ConvertUInt64ToOct(UInt64 value, char *s) throw();
17 19
20extern const char k_Hex_Upper[16];
21extern 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)))))
27static 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}
35static inline char GetHex_Upper(unsigned v)
36{
37 return (char)((v < 10) ? ('0' + v) : ('A' + (v - 10)));
38}
39*/
40
41
18void ConvertUInt32ToHex(UInt32 value, char *s) throw(); 42void ConvertUInt32ToHex(UInt32 value, char *s) throw();
19void ConvertUInt64ToHex(UInt64 value, char *s) throw(); 43void ConvertUInt64ToHex(UInt64 value, char *s) throw();
20void ConvertUInt32ToHex8Digits(UInt32 value, char *s) throw(); 44void 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
23void ConvertInt64ToString(Int64 value, char *s) throw();
24void 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.
27char *RawLeGuidToString(const Byte *guid, char *s) throw(); 48char *RawLeGuidToString(const Byte *guid, char *s) throw();
28char *RawLeGuidToString_Braced(const Byte *guid, char *s) throw(); 49char *RawLeGuidToString_Braced(const Byte *guid, char *s) throw();
29 50
51void ConvertDataToHex_Lower(char *dest, const Byte *src, size_t size) throw();
52void ConvertDataToHex_Upper(char *dest, const Byte *src, size_t size) throw();
53
30#endif 54#endif