ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
numberconversion.hpp
Go to the documentation of this file.
1/** ************************************************************************************************
2 * \file
3 * This header file is part of module \alib_strings of the \aliblong.
4 *
5 * \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
6 * Published under \ref mainpage_license "Boost Software License".
7 **************************************************************************************************/
8#ifndef HPP_ALIB_STRINGS_DETAIL_NUMBERCONVERSION
9#define HPP_ALIB_STRINGS_DETAIL_NUMBERCONVERSION 1
10
11#if !defined (HPP_ALIB_STRINGS_NUMBERFORMAT)
13#endif
14
15namespace alib { namespace strings { namespace detail {
16
17
18// clang 7.0.1 - 14.0.6 (as of today 221216) falsely reports:
19// "warning: '@tparam' command used in a comment that is not attached to a template declaration
20#if !defined(ALIB_DOX)
22#endif
23
24/** ************************************************************************************************
25* Reads digits \c '0' to \c '9' into a positive integral value.
26 *
27 * \note
28 * The function is very basic, i.e. it does not use an object of type
29 * \alib{strings;TNumberFormat}, does not tolerate group characters and so forth.
30 * Instead, it simply reads decimal digits, until a non-digit character
31 * is found or the string ends.
32 *
33 * @tparam TChar The character type of the string to parse from.
34 * @param src The string to read the value from.
35 * @param[in,out] idx The start point for parsing within \p{src}. Will be set to point
36 * behind the last character consumed. If unchanged, this indicates
37 * that no parsable number was found. If out of bounds, \c 0 is returned.
38 * @return The parsed value. In addition, on success, parameter \p{idx} is moved to point to the
39 * first character behind the parsed number.
40 **************************************************************************************************/
41template<typename TChar>
42uint64_t ParseDecDigits( const TString<TChar>& src, integer& idx );
43
44
45/** ************************************************************************************************
46* Parses signed integer numbers, optionally in binary, hexadecimal or octal format.
47 *
48 * Leading characters defined in field \alib{strings::TNumberFormat;Whitespaces} of the
49 * \b NumberFormat object given with \p{nf} are ignored.
50 * An optional sign character \c '+' or \c '-' is parsed. If found, again whitespace characters
51 * may follow behind such sign and are ignored.
52 *
53 * Then, the function detects any literal prefixes as defined in fields
54 * \alib{strings::TNumberFormat;BinLiteralPrefix},
55 * \alib{strings::TNumberFormat;HexLiteralPrefix} and
56 * \alib{strings::TNumberFormat;OctLiteralPrefix} (usually \c 0b, \c 0x and \c 0o) and
57 * invokes one of the functions #ParseDec, #ParseBin, #ParseHex or #ParseOct.
58 *
59 * @tparam TChar The character type of the string to parse from.
60 * @param src The string to read the value from.
61 * @param[in,out] idx The start point for parsing within \p{src}. Will be set to point
62 * behind the last character consumed. If unchanged, this indicates
63 * that no parsable number was found.
64 * @param nf The number format to use.
65 * @return The parsed value. In addition, on success, parameter \p{idx} is moved to point to the
66 * first character behind the parsed number.
67 **************************************************************************************************/
68template<typename TChar>
70int64_t ParseInt( const TString<TChar>& src, integer& idx, const TNumberFormat<TChar>& nf );
71
72/** ************************************************************************************************
73 * Reads an unsigned integral value in \b decimal format from the given character
74 * array at the given position.<br>
75 * Sign literals \c '-' or \c '+' are \b not accepted and parsing will fail if found.
76 * Whitespace and grouping characters, as defined in fields
77 * \alib{strings::TNumberFormat;Whitespaces} and
78 * \alib{strings::TNumberFormat;ThousandsGroupChar} of the \b NumberFormat object given with \p{nf}
79 * will be ignored (tolerated) regardless on their position between digits. To suppress the parsing
80 * of group characters, set field \alib{strings::TNumberFormat;ThousandsGroupChar} to <c>'\\0'</c>.
81 * To suppress whitespace consumption before reading the value, set field
82 * \alib{strings::TNumberFormat;Whitespaces} to \e nulled or empty string.
83 *
84 *
85 * @tparam TChar The character type of the string to parse from.
86 * @param src The string to read the value from.
87 * @param[in,out] idx The start point for parsing within \p{src}. Will be set to point
88 * behind the last character consumed. If unchanged, this indicates
89 * that no parsable number was found.
90 * @param nf The number format to use.
91 * @return The parsed value. In addition, on success, parameter \p{idx} is moved to point to the
92 * first character behind the parsed number.
93 **************************************************************************************************/
94template<typename TChar>
96uint64_t ParseDec( const TString<TChar>& src, integer& idx, const TNumberFormat<TChar>& nf );
97
98/** ************************************************************************************************
99* Reads an unsigned integral value in \b binary format from the given character
100 * array at the given position.<br>
101 * Sign literals \c '-' or \c '+' are \b not accepted and parsing will fail if found.
102 * Whitespace and grouping characters, as defined in fields
103 * \alib{strings::TNumberFormat;Whitespaces},
104 * \alib{strings::TNumberFormat;BinNibbleGroupChar},
105 * \alib{strings::TNumberFormat;BinByteGroupChar}
106 * \alib{strings::TNumberFormat;BinWordGroupChar} and
107 * \alib{strings::TNumberFormat;BinWord32GroupChar} of the \b NumberFormat object given with \p{nf},
108 * will be ignored (tolerated), regardless on their position between digits. To suppress the parsing
109 * of group characters, set the fields to <c>'\\0'</c>. To suppress whitespace consumption,
110 * set field \alib{strings::TNumberFormat;Whitespaces} to \e nulled or empty string.<br>
111 *
112 * @tparam TChar The character type of the string to parse from.
113 * @param src The string to read the value from.
114 * @param[in,out] idx The start point for parsing within \p{src}. Will be set to point
115 * behind the last character consumed. If unchanged, this indicates
116 * that no parsable number was found.
117 * @param nf The number format to use.
118 * @return The parsed value. In addition, on success, parameter \p{idx} is moved to point to the
119 * first character behind the parsed number.
120 **************************************************************************************************/
121template<typename TChar>
123uint64_t ParseBin( const TString<TChar>& src, integer& idx, const TNumberFormat<TChar>& nf );
124
125/** ************************************************************************************************
126* Reads an unsigned integral value in \b hexadecimal format from the given character
127 * array at the given position.<br>
128 * Sign literals \c '-' or \c '+' are \b not accepted and parsing will fail if found.
129 * Whitespace and grouping characters, as defined in fields
130 * \alib{strings::TNumberFormat;Whitespaces},
131 * \alib{strings::TNumberFormat;HexByteGroupChar},
132 * \alib{strings::TNumberFormat;HexWordGroupChar} and
133 * \alib{strings::TNumberFormat;HexWord32GroupChar} of the \b NumberFormat object given with \p{nf},
134 * will be ignored (tolerated) regardless of their position between digits. To suppress the parsing
135 * of group characters, set the fields to <c>'\\0'</c>. To suppress whitespace consumption,
136 * set field \alib{strings::TNumberFormat;Whitespaces} to \e nulled or empty string.<br>
137 *
138 * Letters 'a' to 'f' are parsed ignoring their case. This is independent from the setting of flag
139 * \alib{strings;NumberFormatFlags;HexLowerCase} in field
140 * \alib{strings::NumberFormat;Flags} of given \p{nf}.
141 *
142 * @tparam TChar The character type of the string to parse from.
143 * @param src The string to read the value from.
144 * @param[in,out] idx The start point for parsing within \p{src}. Will be set to point
145 * behind the last character consumed. If unchanged, this indicates
146 * that no parsable number was found.
147 * @param nf The number format to use.
148 * @return The parsed value. In addition, on success, parameter \p{idx} is moved to point to the
149 * first character behind the parsed number.
150 **************************************************************************************************/
151template<typename TChar>
153uint64_t ParseHex( const TString<TChar>& src, integer& idx, const TNumberFormat<TChar>& nf );
154
155/** ************************************************************************************************
156* Reads an unsigned integral value in \b binary format from the given character
157 * array at the given position.<br>
158 * Sign literals \c '-' or \c '+' are \b not accepted and parsing will fail if found.
159 * Whitespace and grouping characters, as defined in fields
160 * \alib{strings::TNumberFormat;Whitespaces} and
161 * \alib{strings::TNumberFormat;OctGroupChar} of the \b NumberFormat object given with \p{nf},
162 * will be ignored (tolerated) regardless of their position between digits. To suppress the parsing
163 * of group characters, set the field to <c>'\\0'</c>. To suppress whitespace consumption,
164 * set field \alib{strings::TNumberFormat;Whitespaces} to \e nulled or empty string.<br>
165 *
166 * @tparam TChar The character type of the string to parse from.
167 * @param src The string to read the value from.
168 * @param[in,out] idx The start point for parsing within \p{src}. Will be set to point
169 * behind the last character consumed. If unchanged, this indicates
170 * that no parsable number was found.
171 * @param nf The number format to use.
172 * @return The parsed value. In addition, on success, parameter \p{idx} is moved to point to the
173 * first character behind the parsed number.
174 **************************************************************************************************/
175template<typename TChar>
177uint64_t ParseOct( const TString<TChar>& src, integer& idx, const TNumberFormat<TChar>& nf );
178
179/** ************************************************************************************************
180* Reads a floating point value from the given character array at the given position.<br>
181 * Sign literals \c '-' or \c '+' are \b not accepted and parsing will fail if found.
182 *
183 * If the strings defined in fields
184 * \alib{strings::TNumberFormat;NANLiteral} and
185 * \alib{strings::TNumberFormat;INFLiteral} are found in the \b NumberFormat object given with
186 * \p{nf}, the corresponding double constant (not a number, positive/negative infinity) will be
187 * returned.
188 *
189 * @tparam TChar The character type of the string to parse from.
190 * @param src The string to read the value from.
191 * @param[in,out] idx The start point for parsing within \p{src}. Will be set to point
192 * behind the last character consumed. If unchanged, this indicates
193 * that no parsable number was found.
194 * @param nf The number format to use.
195 * @return The parsed value. In addition, on success, parameter \p{idx} is moved to point to the
196 * first character behind the parsed number.
197 **************************************************************************************************/
198template<typename TChar>
200double ParseFloat( const TString<TChar>& src, integer& idx, const TNumberFormat<TChar>& nf );
201
202/** ************************************************************************************************
203* Converts the given long value to a string representation in decimal format.<br>
204 *
205 * The maximum number of digits written is 20. In addition, grouping characters may be written
206 * according the flags
207 * \alib{strings;NumberFormatFlags;WriteGroupChars},
208 * \alib{strings;NumberFormatFlags;ThousandsGroupChar} and
209 * \alib{strings;NumberFormatFlags;LeadingGroupCharReplacement}
210 *
211 * in field \alib{strings::NumberFormat;Flags} of given \p{nf}.
212 *
213 * The minimum width of the output is taken from field
214 * \alib{strings::TNumberFormat;DecMinimumFieldWidth} unless overwritten by parameter \p{minWidth}.
215 * If the minimum width is greater than the sum of digits and* grouping characters needed to write
216 * \p{value}, then \c '0' digits are prepended between the sign
217 * and the number.
218 *
219 * \attention
220 * The function does not (and can not) check an overflow of the given character buffer
221 * when writing.
222 *
223 * \see
224 * Function #WriteDecSigned to write signed decimals.
225 *
226 * @tparam TChar The character type of the string to write into.
227 * @param value The value to write.
228 * @param buffer The character array to write the value to. Needs to be long enough
229 * (after \p{idx}) to carry the string written.
230 * @param idx The index within \p{buffer} to start writing.
231 * @param minWidth The minimum width of the output.
232 * If \c 0, the value of \b DecMinimumFieldWidth of argument \p{nf} is used.
233 * @param nf Number format definitions.
234 * @return The index pointing to behind the last character written in \b buffer.
235 **************************************************************************************************/
236template<typename TChar>
238integer WriteDecUnsigned( uint64_t value, TChar* buffer, integer idx, int minWidth,
239 const TNumberFormat<TChar>& nf );
240
241/** ************************************************************************************************
242* Converts the given long value to a string representation into a signed decimal format.<br>
243 * For negative numbers, \c '-' is written, the sign of positive numbers (if any) depends
244 * on field \alib{strings::TNumberFormat;PlusSign} of the \b NumberFormat object given with \p{nf}.
245 * After that, the value is negated (made positive) and #WriteDecUnsigned is invoked.
246 *
247 * @tparam TChar The character type of the string to write into.
248 * @param value The value to write.
249 * @param buffer The character array to write the value to. Needs to be long enough
250 * (after \p{idx}) to carry the string written.
251 * @param idx The index within \p{buffer} to start writing.
252 * @param minWidth The minimum width of the output.
253 * If \c 0, the value of \b DecMinimumFieldWidth in \p{nf} is used.
254 * @param nf Number format definitions.
255 * @return The index pointing to behind the last character written in \b buffer.
256 **************************************************************************************************/
257template<typename TChar>
259integer WriteDecSigned( int64_t value, TChar* buffer, integer idx, int minWidth,
260 const TNumberFormat<TChar>& nf );
261
262/** ************************************************************************************************
263* Converts the given long value to a string representation in binary format.<br>
264 *
265 * The maximum number of digits written is 64. In addition, grouping characters may be written
266 * according the settings of flags
267 * \alib{strings;NumberFormatFlags;WriteGroupChars},
268 * \alib{strings;NumberFormatFlags;BinNibbleGroupChar},
269 * \alib{strings;NumberFormatFlags;BinByteGroupChar},
270 * \alib{strings;NumberFormatFlags;BinWordGroupChar},
271 * \alib{strings;NumberFormatFlags;BinWord32GroupChar} and
272 * \alib{strings;NumberFormatFlags;LeadingGroupCharReplacement}
273 *
274 * of the \b NumberFormat object given with \p{nf}.
275 *
276 * The minimum width of the output is taken from field \alib{strings::TNumberFormat;BinFieldWidth}
277 * unless overwritten by parameter \p{minWidth}. If the width is greater than digits found in
278 * \p{value}, \c '0' digits are prepended. The width is taking group characters into account.
279 *
280 * \attention
281 * The function does not (and can not) check an overflow of the given character buffer
282 * when writing.
283 *
284 * \attention
285 * If the value is greater than can be represented by the output width, these greater
286 * digits are cut. This is true for this function as well as for #WriteHex and #WriteOct. The
287 * rationale behind this is that this way, larger numbers do not need to be masked before
288 * writing.
289 * (In other words: it is assumed that there is a reason for providing the width).
290 *
291 * \note
292 * The literal prefix found in field \alib{strings::TNumberFormat;BinLiteralPrefix} of \p{nf}
293 * is \b not written. The field is only used for detecting formats with function #ParseInt.
294 *
295 * @tparam TChar The character type of the string to write into.
296 * @param value The value to write.
297 * @param buffer The character array to write the value to. Needs to be long enough
298 * (after \p{idx}) to carry the string written.
299 * @param idx The index within \p{buffer} to start writing.
300 * @param minWidth The minimum width of the output.
301 * If \c 0, the value of \b BinFieldWidth of argument \p{nf} is used.
302 * @param nf Number format definitions.
303 * @return The index pointing to behind the last character written in \b buffer.
304 **************************************************************************************************/
305template<typename TChar>
307integer WriteBin( uint64_t value, TChar* buffer, integer idx, int minWidth,
308 const TNumberFormat<TChar>& nf );
309
310
311/** ************************************************************************************************
312* Converts the given long value to a string representation in hexadecimal format.<br>
313 *
314 * The maximum number of digits written is \b 16. In addition, grouping characters may be written
315 * according the settings of flags
316 * \alib{strings;NumberFormatFlags;WriteGroupChars},
317 * \alib{strings;NumberFormatFlags;HexByteGroupChar},
318 * \alib{strings;NumberFormatFlags;HexWordGroupChar},
319 * \alib{strings;NumberFormatFlags;HexWord32GroupChar} and
320 * \alib{strings;NumberFormatFlags;LeadingGroupCharReplacement}
321 *
322 * in field \alib{strings::NumberFormat;Flags} of given \p{nf}.
323 *
324 * The minimum width of the output is taken from field \alib{strings::TNumberFormat;HexFieldWidth}
325 * unless overwritten by parameter \p{minWidth}. If the width is greater than digits found in
326 * \p{value}, \c '0' digits are prepended. The width is taking group characters into account.
327 *
328 * \attention
329 * The function does not (and can not) check an overflow of the given character buffer
330 * when writing.
331 *
332 * \attention
333 * If the value is greater than can be represented by the output width, these greater
334 * digits are cut. This is true for this function as well as #WriteBin and writeOct. The
335 * rationale behind this is that this way, larger numbers do not need to be masked before
336 * writing.
337 * (In other words: it is assumed that there is a reason for providing the width).
338 *
339 * \note
340 * The literal prefix found in field \alib{strings::TNumberFormat;HexLiteralPrefix} of \p{nf}
341 * is \b not written. The field is only used for detecting formats with function #ParseInt.
342 *
343 * @tparam TChar The character type of the string to write into.
344 * @param value The value to write.
345 * @param buffer The character array to write the value to. Needs to be long enough
346 * (after \p{idx}) to carry the string written.
347 * @param idx The index within \p{buffer} to start writing.
348 * @param minWidth The minimum width of the output.
349 * If \c 0, the value of \b HexFieldWidth of argument \p{nf} is used.
350 * @param nf Number format definitions.
351 * @return The index pointing to behind the last character written in \b buffer.
352 **************************************************************************************************/
353template<typename TChar>
355integer WriteHex( uint64_t value, TChar* buffer, integer idx, int minWidth,
356 const TNumberFormat<TChar>& nf );
357
358/** ************************************************************************************************
359* Converts the given long value to a string representation in octal format.<br>
360 *
361 * The maximum number of digits written is 64. In addition, grouping characters may be written
362 * according the settings of flags
363 * \alib{strings;NumberFormatFlags;WriteGroupChars},
364 * \alib{strings;NumberFormatFlags;OctGroupChar} and
365 * \alib{strings;NumberFormatFlags;LeadingGroupCharReplacement}.
366 *
367 * in field* \alib{strings::NumberFormat;Flags} of given \p{nf}.
368 *
369 * The minimum width of the output is taken from field \alib{strings::TNumberFormat;OctFieldWidth}
370 * unless overwritten by parameter \p{minWidth}. If the width is greater than digits found in
371 * \p{value}, \c '0' digits are prepended. The width is taking group characters into account.
372 *
373 * \attention
374 * The function does not (and can not) check an overflow of the given character buffer
375 * when writing.
376 *
377 * \attention
378 * If the value is greater than can be represented by the output width, these greater
379 * digits are cut. This is true for this function as well as #WriteBin and writeHex. The
380 * rationale behind this is that this way, larger numbers do not need to be masked before
381 * writing.
382 * (In other words: it is assumed that there is a reason for providing the width).
383 *
384 * \note
385 * The literal prefix found in field \alib{strings::TNumberFormat;OctLiteralPrefix} of \p{nf}
386 * is \b not written. The field is only used for detecting formats with function #ParseInt.
387 *
388 * @tparam TChar The character type of the string to write into.
389 * @param value The value to write.
390 * @param buffer The character array to write the value to. Needs to be long enough
391 * (after \p{idx}) to carry the string written.
392 * @param idx The index within \p{buffer} to start writing.
393 * @param minWidth The minimum width of the output.
394 * If \c 0, the value of \b OctFieldWidth of argument \p{nf} is used.
395 * @param nf Number format definitions.
396 * @return The index pointing to behind the last character written in \b buffer.
397 **************************************************************************************************/
398template<typename TChar>
400integer WriteOct( uint64_t value, TChar* buffer, integer idx, int minWidth,
401 const TNumberFormat<TChar>& nf );
402
403/** ************************************************************************************************
404* Writes a string representation of the given \c double value.
405 *
406 * Grouping characters are written according the settings of flags
407 * \alib{strings;NumberFormatFlags;;WriteGroupChars},
408 * \alib{strings;NumberFormatFlags;;ThousandsGroupChar} and
409 * \alib{strings;NumberFormatFlags;;LeadingGroupCharReplacement}
410 *
411 * of field \alib{strings::NumberFormat;Flags} in given \p{nf}.
412 *
413 * The minimum width of the integral part of the output is taken from field
414 * \alib{strings::TNumberFormat;IntegralPartMinimumWidth} unless overwritten by parameter
415 * \p{minWidth}.
416 * If the width is greater than integral digits found in \p{value}, \c '0' digits are prepended.
417 * The width is taking group characters into account.
418 *
419 * If field \alib{strings::TNumberFormat;FractionalPartWidth} as well as the width of the integral
420 * part (provided or set) equals \c -1 the function may choose scientific notation.
421 * This is done for numbers smaller than <c>10E-4</c> or larger than <c>10E+6</c>.<br>
422 *
423 * If the given value is not a number, \alib{strings::TNumberFormat;NANLiteral} is written.
424 * If infinite, \alib{strings::TNumberFormat;INFLiteral}.
425 *
426 * The output format is dependent on various further settings provided in field
427 * \alib{strings::NumberFormat;Flags} of given \p{nf}. Those are
428 * \alib{strings;NumberFormatFlags;DecimalPointChar},
429 * \alib{strings;NumberFormatFlags;ExponentSeparator},
430 * \alib{strings;NumberFormatFlags;ForceDecimalPoint},
431 * \alib{strings;NumberFormatFlags;WriteExponentPlusSign} and
432 * \alib{strings;NumberFormatFlags;ForceScientific}.
433 *
434 * \attention
435 * The function does not (and can not) check an overflow of the given character buffer
436 * when writing.
437 *
438 * @tparam TChar The character type of the string to write into.
439 * @param value The value to write.
440 * @param buffer The character array to write the value to. Needs to be long enough
441 * (after \p{idx}) to carry the string written.
442 * @param idx The index within \p{buffer} to start writing.
443 * @param minWidth The minimum width of the integral part of the output.
444 * If \c 0, the value of \b IntegralPartMinimumWidth of argument \p{nf} is used.
445 * @param nf Number format definitions.
446 * @return The index pointing to behind the last character written in \b buffer.
447 **************************************************************************************************/
448template<typename TChar>
450integer WriteFloat( double value, TChar* buffer, integer idx, int minWidth,
451 const TNumberFormat<TChar>& nf );
452
454
455
456
457// #################################################################################################
458// Template instantiation declarations
459// #################################################################################################
460#if !defined(ALIB_DOX)
461
462extern template ALIB_API uint64_t ParseDecDigits <nchar>( const TString<nchar>&, integer& );
463extern template ALIB_API int64_t ParseInt <nchar>( const TString<nchar>&, integer&, const TNumberFormat<nchar>& );
464extern template ALIB_API uint64_t ParseDec <nchar>( const TString<nchar>&, integer&, const TNumberFormat<nchar>& );
465extern template ALIB_API uint64_t ParseBin <nchar>( const TString<nchar>&, integer&, const TNumberFormat<nchar>& );
466extern template ALIB_API uint64_t ParseHex <nchar>( const TString<nchar>&, integer&, const TNumberFormat<nchar>& );
467extern template ALIB_API uint64_t ParseOct <nchar>( const TString<nchar>&, integer&, const TNumberFormat<nchar>& );
468extern template ALIB_API double ParseFloat <nchar>( const TString<nchar>&, integer&, const TNumberFormat<nchar>& );
469extern template ALIB_API integer WriteDecUnsigned<nchar>( uint64_t, nchar*, integer, int, const TNumberFormat<nchar>& );
470extern template ALIB_API integer WriteDecSigned <nchar>( int64_t , nchar*, integer, int, const TNumberFormat<nchar>& );
471extern template ALIB_API integer WriteBin <nchar>( uint64_t, nchar*, integer, int, const TNumberFormat<nchar>& );
472extern template ALIB_API integer WriteHex <nchar>( uint64_t, nchar*, integer, int, const TNumberFormat<nchar>& );
473extern template ALIB_API integer WriteOct <nchar>( uint64_t, nchar*, integer, int, const TNumberFormat<nchar>& );
474extern template ALIB_API integer WriteFloat <nchar>( double , nchar*, integer, int, const TNumberFormat<nchar>& );
475
476extern template ALIB_API uint64_t ParseDecDigits <wchar>( const TString<wchar>&, integer& );
477extern template ALIB_API int64_t ParseInt <wchar>( const TString<wchar>&, integer&, const TNumberFormat<wchar>& );
478extern template ALIB_API uint64_t ParseDec <wchar>( const TString<wchar>&, integer&, const TNumberFormat<wchar>& );
479extern template ALIB_API uint64_t ParseBin <wchar>( const TString<wchar>&, integer&, const TNumberFormat<wchar>& );
480extern template ALIB_API uint64_t ParseHex <wchar>( const TString<wchar>&, integer&, const TNumberFormat<wchar>& );
481extern template ALIB_API uint64_t ParseOct <wchar>( const TString<wchar>&, integer&, const TNumberFormat<wchar>& );
482extern template ALIB_API double ParseFloat <wchar>( const TString<wchar>&, integer&, const TNumberFormat<wchar>& );
483extern template ALIB_API integer WriteDecUnsigned<wchar>( uint64_t, wchar*, integer, int, const TNumberFormat<wchar>& );
484extern template ALIB_API integer WriteDecSigned <wchar>( int64_t , wchar*, integer, int, const TNumberFormat<wchar>& );
485extern template ALIB_API integer WriteBin <wchar>( uint64_t, wchar*, integer, int, const TNumberFormat<wchar>& );
486extern template ALIB_API integer WriteHex <wchar>( uint64_t, wchar*, integer, int, const TNumberFormat<wchar>& );
487extern template ALIB_API integer WriteOct <wchar>( uint64_t, wchar*, integer, int, const TNumberFormat<wchar>& );
488extern template ALIB_API integer WriteFloat <wchar>( double , wchar*, integer, int, const TNumberFormat<wchar>& );
489
490extern template ALIB_API uint64_t ParseDecDigits <xchar>( const TString<xchar>&, integer& );
491extern template ALIB_API int64_t ParseInt <xchar>( const TString<xchar>&, integer&, const TNumberFormat<xchar>& );
492extern template ALIB_API uint64_t ParseDec <xchar>( const TString<xchar>&, integer&, const TNumberFormat<xchar>& );
493extern template ALIB_API uint64_t ParseBin <xchar>( const TString<xchar>&, integer&, const TNumberFormat<xchar>& );
494extern template ALIB_API uint64_t ParseHex <xchar>( const TString<xchar>&, integer&, const TNumberFormat<xchar>& );
495extern template ALIB_API uint64_t ParseOct <xchar>( const TString<xchar>&, integer&, const TNumberFormat<xchar>& );
496extern template ALIB_API double ParseFloat <xchar>( const TString<xchar>&, integer&, const TNumberFormat<xchar>& );
497extern template ALIB_API integer WriteDecUnsigned<xchar>( uint64_t, xchar*, integer, int, const TNumberFormat<xchar>& );
498extern template ALIB_API integer WriteDecSigned <xchar>( int64_t , xchar*, integer, int, const TNumberFormat<xchar>& );
499extern template ALIB_API integer WriteBin <xchar>( uint64_t, xchar*, integer, int, const TNumberFormat<xchar>& );
500extern template ALIB_API integer WriteHex <xchar>( uint64_t, xchar*, integer, int, const TNumberFormat<xchar>& );
501extern template ALIB_API integer WriteOct <xchar>( uint64_t, xchar*, integer, int, const TNumberFormat<xchar>& );
502extern template ALIB_API integer WriteFloat <xchar>( double , xchar*, integer, int, const TNumberFormat<xchar>& );
503#endif //!defined(ALIB_DOX)
504
505
506}}} // namespace [alib::strings::detail]
507
508
509#endif // HPP_ALIB_STRINGS_DETAIL_NUMBERCONVERSION
#define ALIB_WARNINGS_RESTORE
Definition alib.hpp:715
#define ALIB_API
Definition alib.hpp:538
#define ALIB_WARNINGS_IGNORE_DOCS
Definition alib.hpp:702
ALIB_API uint64_t ParseOct(const TString< TChar > &src, integer &idx, const TNumberFormat< TChar > &nf)
ALIB_API int64_t ParseInt(const TString< TChar > &src, integer &idx, const TNumberFormat< TChar > &nf)
ALIB_API integer WriteFloat(double value, TChar *buffer, integer idx, int minWidth, const TNumberFormat< TChar > &nf)
ALIB_API integer WriteDecUnsigned(uint64_t value, TChar *buffer, integer idx, int minWidth, const TNumberFormat< TChar > &nf)
ALIB_API integer WriteOct(uint64_t value, TChar *buffer, integer idx, int minWidth, const TNumberFormat< TChar > &nf)
ALIB_API uint64_t ParseHex(const TString< TChar > &src, integer &idx, const TNumberFormat< TChar > &nf)
ALIB_API integer WriteDecSigned(int64_t value, TChar *buffer, integer idx, int minWidth, const TNumberFormat< TChar > &nf)
ALIB_API uint64_t ParseBin(const TString< TChar > &src, integer &idx, const TNumberFormat< TChar > &nf)
uint64_t ParseDecDigits(const TString< TChar > &src, integer &idx)
ALIB_API double ParseFloat(const TString< TChar > &src, integer &idx, const TNumberFormat< TChar > &nf)
ALIB_API uint64_t ParseDec(const TString< TChar > &src, integer &idx, const TNumberFormat< TChar > &nf)
ALIB_API integer WriteHex(uint64_t value, TChar *buffer, integer idx, int minWidth, const TNumberFormat< TChar > &nf)
ALIB_API integer WriteBin(uint64_t value, TChar *buffer, integer idx, int minWidth, const TNumberFormat< TChar > &nf)
Definition alib.cpp:57
characters::wchar wchar
Type alias in namespace alib.
characters::xchar xchar
Type alias in namespace alib.
characters::nchar nchar
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
Definition integers.hpp:286