comparison Core/Toolbox.h @ 2367:2aff870c2c58

refactoring of BoostConfiguration.cmake
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Aug 2017 17:32:13 +0200
parents 9c7a80c87ae9
children 68380777f9a6
comparison
equal deleted inserted replaced
2366:26f3a346226f 2367:2aff870c2c58
43 43
44 #if !defined(ORTHANC_ENABLE_BASE64) 44 #if !defined(ORTHANC_ENABLE_BASE64)
45 # error The macro ORTHANC_ENABLE_BASE64 must be defined 45 # error The macro ORTHANC_ENABLE_BASE64 must be defined
46 #endif 46 #endif
47 47
48 #if !defined(ORTHANC_ENABLE_LOCALE)
49 # error The macro ORTHANC_ENABLE_LOCALE must be defined
50 #endif
51
48 #if !defined(ORTHANC_ENABLE_MD5) 52 #if !defined(ORTHANC_ENABLE_MD5)
49 # error The macro ORTHANC_ENABLE_MD5 must be defined 53 # error The macro ORTHANC_ENABLE_MD5 must be defined
50 #endif 54 #endif
51 55
52 #if !defined(ORTHANC_ENABLE_PUGIXML) 56 #if !defined(ORTHANC_ENABLE_PUGIXML)
53 # error The macro ORTHANC_ENABLE_PUGIXML must be defined 57 # error The macro ORTHANC_ENABLE_PUGIXML must be defined
54 #endif
55
56 #if !defined(BOOST_HAS_REGEX)
57 # error The macro BOOST_HAS_REGEX must be defined
58 #endif 58 #endif
59 59
60 60
61 /** 61 /**
62 * NOTE: GUID vs. UUID 62 * NOTE: GUID vs. UUID
130 const std::string& data); 130 const std::string& data);
131 131
132 void EncodeBase64(std::string& result, 132 void EncodeBase64(std::string& result,
133 const std::string& data); 133 const std::string& data);
134 134
135 # if BOOST_HAS_REGEX == 1
136 bool DecodeDataUriScheme(std::string& mime, 135 bool DecodeDataUriScheme(std::string& mime,
137 std::string& content, 136 std::string& content,
138 const std::string& source); 137 const std::string& source);
139 # endif
140 138
141 void EncodeDataUriScheme(std::string& result, 139 void EncodeDataUriScheme(std::string& result,
142 const std::string& mime, 140 const std::string& mime,
143 const std::string& content); 141 const std::string& content);
144 #endif 142 #endif
145 143
144 #if ORTHANC_ENABLE_LOCALE == 1
146 std::string ConvertToUtf8(const std::string& source, 145 std::string ConvertToUtf8(const std::string& source,
147 Encoding sourceEncoding); 146 Encoding sourceEncoding);
148 147
149 std::string ConvertFromUtf8(const std::string& source, 148 std::string ConvertFromUtf8(const std::string& source,
150 Encoding targetEncoding); 149 Encoding targetEncoding);
150 #endif
151 151
152 bool IsAsciiString(const void* data, 152 bool IsAsciiString(const void* data,
153 size_t size); 153 size_t size);
154 154
155 std::string ConvertToAscii(const std::string& source); 155 std::string ConvertToAscii(const std::string& source);
159 // In-place percent-decoding for URL 159 // In-place percent-decoding for URL
160 void UrlDecode(std::string& s); 160 void UrlDecode(std::string& s);
161 161
162 Endianness DetectEndianness(); 162 Endianness DetectEndianness();
163 163
164 #if BOOST_HAS_REGEX == 1
165 std::string WildcardToRegularExpression(const std::string& s); 164 std::string WildcardToRegularExpression(const std::string& s);
166 #endif
167 165
168 void TokenizeString(std::vector<std::string>& result, 166 void TokenizeString(std::vector<std::string>& result,
169 const std::string& source, 167 const std::string& source,
170 char separator); 168 char separator);
171 169
205 203
206 bool IsUuid(const std::string& str); 204 bool IsUuid(const std::string& str);
207 205
208 bool StartsWithUuid(const std::string& str); 206 bool StartsWithUuid(const std::string& str);
209 207
208 #if ORTHANC_ENABLE_LOCALE == 1
210 void InitializeGlobalLocale(const char* locale); 209 void InitializeGlobalLocale(const char* locale);
211 210
212 void FinalizeGlobalLocale(); 211 void FinalizeGlobalLocale();
212 #endif
213 213
214 std::string ToUpperCaseWithAccents(const std::string& source); 214 std::string ToUpperCaseWithAccents(const std::string& source);
215 } 215 }
216 } 216 }