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