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