ALib C++ Framework
by
Library Version: 2511 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 #"mainpage_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/// #"str 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 #"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/// #"TNumberFormat::BinLiteralPrefix",
41/// #"TNumberFormat::HexLiteralPrefix" and
42/// #"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/// #"TNumberFormat::Whitespaces" and
64/// #"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 #"TNumberFormat::ThousandsGroupChar" to <c>'\\0'</c>.
67/// To suppress whitespace consumption before reading the value, set field
68/// #"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/// #"TNumberFormat::Whitespaces",
90/// #"TNumberFormat::BinNibbleGroupChar",
91/// #"TNumberFormat::BinByteGroupChar"
92/// #"TNumberFormat::BinWordGroupChar" and
93/// #"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 #"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/// #"TNumberFormat::Whitespaces",
117/// #"TNumberFormat::HexByteGroupChar",
118/// #"TNumberFormat::HexWordGroupChar" and
119/// #"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 #"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 the
125/// flag #"NumberFormatFlags::HexLowerCase" in the field #"TNumberFormat::Flags" of the given
126/// \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/// #"TNumberFormat::Whitespaces" and
147/// #"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 #"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/// #"TNumberFormat::NANLiteral" and
171/// #"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 flag #"NumberFormatFlags::WriteGroupChars" and the fields
193/// #"ThousandsGroupChar" and #"LeadingGroupCharReplacement"
194/// of the given \p{nf}.
195///
196/// The minimum width of the output is taken from field
197/// #"TNumberFormat::DecMinimumFieldWidth" unless overwritten by parameter \p{minWidth}.
198/// If the minimum width is greater than the sum of digits and* grouping characters needed to write
199/// \p{value}, then \c '0' digits are prepended between the sign
200/// and the number.
201///
202/// \attention
203/// The function does not (and cannot) check an overflow of the given character buffer
204/// when writing.
205///
206/// \see
207/// Function #WriteDecSigned to write signed decimals.
208///
209/// @tparam TChar The character type of the string to write into.
210/// @param value The value to write.
211/// @param buffer The character array to write the value to. Needs to be long enough
212/// (after \p{idx}) to carry the string written.
213/// @param idx The index within \p{buffer} to start writing.
214/// @param minWidth The minimum width of the output.
215/// If \c 0, the value of \b DecMinimumFieldWidth of argument \p{nf} is used.
216/// @param nf Number format definitions.
217/// @return The index pointing to behind the last character written in \b buffer.
218//==================================================================================================
219template<typename TChar>
221integer WriteDecUnsigned( uint64_t value, TChar* buffer, integer idx, int minWidth,
222 const TNumberFormat<TChar>& nf );
223
224//==================================================================================================
225/// Converts the given long value to a string representation into a signed decimal format.<br>
226/// For negative numbers, \c '-' is written, the sign of positive numbers (if any) depends
227/// on field #"TNumberFormat::PlusSign" of the \b NumberFormat object given with \p{nf}.
228/// After that, the value is negated (made positive) and #WriteDecUnsigned is invoked.
229///
230/// @tparam TChar The character type of the string to write into.
231/// @param value The value to write.
232/// @param buffer The character array to write the value to. Needs to be long enough
233/// (after \p{idx}) to carry the string written.
234/// @param idx The index within \p{buffer} to start writing.
235/// @param minWidth The minimum width of the output.
236/// If \c 0, the value of \b DecMinimumFieldWidth in \p{nf} is used.
237/// @param nf Number format definitions.
238/// @return The index pointing to behind the last character written in \b buffer.
239//==================================================================================================
240template<typename TChar>
242integer WriteDecSigned( int64_t value, TChar* buffer, integer idx, int minWidth,
243 const TNumberFormat<TChar>& nf );
244
245//==================================================================================================
246/// Converts the given long value to a string representation in binary format.<br>
247///
248/// The maximum number of digits written is 64. In addition, grouping characters may be written
249/// according the settings of the flags and fields
250/// #"NumberFormatFlags::WriteGroupChars",
251/// #"TNumberFormat::BinNibbleGroupChar",
252/// #"TNumberFormat::BinByteGroupChar",
253/// #"TNumberFormat::BinWordGroupChar",
254/// #"TNumberFormat::BinWord32GroupChar" and
255/// #"TNumberFormat::LeadingGroupCharReplacement"
256///
257/// of the \b NumberFormat object given with \p{nf}.
258///
259/// The minimum width of the output is taken from field #"TNumberFormat::BinFieldWidth"
260/// unless overwritten by parameter \p{minWidth}. If the width is greater than digits found in
261/// \p{value}, \c '0' digits are prepended. The width is taking group characters into account.
262///
263/// \attention
264/// The function does not (and cannot) check an overflow of the given character buffer
265/// when writing.
266///
267/// \attention
268/// If the value is greater than can be represented by the output width, these greater
269/// digits are cut. This is true for this function as well as for #WriteHex and #WriteOct. The
270/// rationale behind this is that this way, larger numbers do not need to be masked before
271/// writing.
272/// (In other words: it is assumed that there is a reason for providing the width).
273///
274/// \note
275/// The literal prefix found in field #"TNumberFormat::BinLiteralPrefix" of \p{nf}
276/// is \b not written. The field is only used for detecting formats with function #ParseInt.
277///
278/// @tparam TChar The character type of the string to write into.
279/// @param value The value to write.
280/// @param buffer The character array to write the value to. Needs to be long enough
281/// (after \p{idx}) to carry the string written.
282/// @param idx The index within \p{buffer} to start writing.
283/// @param minWidth The minimum width of the output.
284/// If \c 0, the value of \b BinFieldWidth of argument \p{nf} is used.
285/// @param nf Number format definitions.
286/// @return The index pointing to behind the last character written in \b buffer.
287//==================================================================================================
288template<typename TChar>
290integer WriteBin( uint64_t value, TChar* buffer, integer idx, int minWidth,
291 const TNumberFormat<TChar>& nf );
292
293
294//==================================================================================================
295/// Converts the given long value to a string representation in hexadecimal format.<br>
296///
297/// The maximum number of digits written is \b 16. In addition, grouping characters may be written
298/// according the settings of the flags and fields
299/// #"NumberFormatFlags::WriteGroupChars",
300/// #"TNumberFormat::HexByteGroupChar",
301/// #"TNumberFormat::HexWordGroupChar",
302/// #"TNumberFormat::HexWord32GroupChar" and
303/// #"TNumberFormat::LeadingGroupCharReplacement"
304/// of the given \p{nf}.
305///
306/// The minimum width of the output is taken from field #"TNumberFormat::HexFieldWidth"
307/// unless overwritten by the parameter \p{minWidth}. If the width is greater than digits found in
308/// \p{value}, \c '0' digits are prepended. The width is taking group characters into account.
309///
310/// \attention
311/// The function does not (and cannot) check an overflow of the given character buffer
312/// when writing.
313///
314/// \attention
315/// If the value is greater than can be represented by the output width, these greater
316/// digits are cut. This is true for this function as well as #WriteBin and writeOct. The
317/// rationale behind this is that this way, larger numbers do not need to be masked before
318/// writing.
319/// (In other words: it is assumed that there is a reason for providing the width).
320///
321/// \note
322/// The literal prefix found in field #"TNumberFormat::HexLiteralPrefix" of \p{nf}
323/// is \b not written. The field is only used for detecting formats with function #ParseInt.
324///
325/// @tparam TChar The character type of the string to write into.
326/// @param value The value to write.
327/// @param buffer The character array to write the value to. Needs to be long enough
328/// (after \p{idx}) to carry the string written.
329/// @param idx The index within \p{buffer} to start writing.
330/// @param minWidth The minimum width of the output.
331/// If \c 0, the value of \b HexFieldWidth of argument \p{nf} is used.
332/// @param nf Number format definitions.
333/// @return The index pointing to behind the last character written in \b buffer.
334//==================================================================================================
335template<typename TChar>
337integer WriteHex( uint64_t value, TChar* buffer, integer idx, int minWidth,
338 const TNumberFormat<TChar>& nf );
339
340//==================================================================================================
341/// Converts the given long value to a string representation in octal format.<br>
342///
343/// The maximum number of digits written is 64. In addition, grouping characters may be written
344/// according the settings of the flags and fields
345/// #"NumberFormatFlags::WriteGroupChars",
346/// #"TNumberFormat::OctGroupChar" and
347/// #"TNumberFormat::LeadingGroupCharReplacement"
348///
349/// of the given \p{nf}.
350///
351/// The minimum width of the output is taken from field #"TNumberFormat::OctFieldWidth"
352/// unless overwritten by parameter \p{minWidth}. If the width is greater than digits found in
353/// \p{value}, \c '0' digits are prepended. The width is taking group characters into account.
354///
355/// \attention
356/// The function does not (and cannot) check an overflow of the given character buffer
357/// when writing.
358///
359/// \attention
360/// If the value is greater than can be represented by the output width, these greater
361/// digits are cut. This is true for this function as well as #WriteBin and writeHex. The
362/// rationale behind this is that this way, larger numbers do not need to be masked before
363/// writing.
364/// (In other words: it is assumed that there is a reason for providing the width).
365///
366/// \note
367/// The literal prefix found in field #"TNumberFormat::OctLiteralPrefix" of \p{nf}
368/// is \b not written. The field is only used for detecting formats with function #ParseInt.
369///
370/// @tparam TChar The character type of the string to write into.
371/// @param value The value to write.
372/// @param buffer The character array to write the value to. Needs to be long enough
373/// (after \p{idx}) to carry the string written.
374/// @param idx The index within \p{buffer} to start writing.
375/// @param minWidth The minimum width of the output.
376/// If \c 0, the value of \b OctFieldWidth of argument \p{nf} is used.
377/// @param nf Number format definitions.
378/// @return The index pointing to behind the last character written in \b buffer.
379//==================================================================================================
380template<typename TChar>
382integer WriteOct( uint64_t value, TChar* buffer, integer idx, int minWidth,
383 const TNumberFormat<TChar>& nf );
384
385//==================================================================================================
386/// Writes a string representation of the given \c double value.
387///
388/// Grouping characters are written according to the flags and members
389/// #"NumberFormatFlags::WriteGroupChars",
390/// #"TNumberFormat::ThousandsGroupChar" and
391/// #"TNumberFormat::LeadingGroupCharReplacement":
392///
393/// The minimum width of the integral part of the output is taken from field
394/// #"TNumberFormat::IntegralPartMinimumWidth" unless overwritten by parameter
395/// \p{minWidth}.
396/// If the width is greater than integral digits found in \p{value}, \c '0' digits are prepended.
397/// The width is taking group characters into account.
398///
399/// If field #"TNumberFormat::FractionalPartWidth" as well as the width of the integral
400/// part (provided or set) equals \c -1 the function may choose scientific notation.
401/// This is done for numbers smaller than <c>10E-4</c> or larger than <c>10E+6</c>.<br>
402///
403/// If the given value is not a number, #"TNumberFormat::NANLiteral" is written.
404/// If infinite, #"TNumberFormat::INFLiteral".
405///
406/// The output format is dependent on various further settings provided in the flas and fields
407/// of the given \p{nf}. Those are
408/// #"NumberFormatFlags::ForceScientific",
409/// #"NumberFormatFlags::ForceDecimalPoint",
410/// #"NumberFormatFlags::WriteExponentPlusSign",
411/// #"TNumberFormat::DecimalPointChar", and
412/// #"TNumberFormat::ExponentSeparator".
413///
414/// \attention
415/// The function does not (and cannot) check an overflow of the given character buffer
416/// when writing.
417///
418/// @tparam TChar The character type of the string to write into.
419/// @param value The value to write.
420/// @param buffer The character array to write the value to. Needs to be long enough
421/// (after \p{idx}) to carry the string written.
422/// @param idx The index within \p{buffer} to start writing.
423/// @param minWidth The minimum width of the integral part of the output.
424/// If \c 0, the value of \b IntegralPartMinimumWidth of argument \p{nf} is used.
425/// @param nf Number format definitions.
426/// @return The index pointing to behind the last character written in \b buffer.
427//==================================================================================================
428template<typename TChar>
430integer WriteFloat( double value, TChar* buffer, integer idx, int minWidth,
431 const TNumberFormat<TChar>& nf );
432
433
434//##################################################################################################
435// Template instantiation declarations
436//##################################################################################################
437#if !DOXYGEN
438
439extern template ALIB_DLL uint64_t ParseDecDigits <nchar>( const TString<nchar>&, integer& );
440extern template ALIB_DLL int64_t ParseInt <nchar>( const TString<nchar>&, integer&, const TNumberFormat<nchar>& );
441extern template ALIB_DLL uint64_t ParseDec <nchar>( const TString<nchar>&, integer&, const TNumberFormat<nchar>& );
442extern template ALIB_DLL uint64_t ParseBin <nchar>( const TString<nchar>&, integer&, const TNumberFormat<nchar>& );
443extern template ALIB_DLL uint64_t ParseHex <nchar>( const TString<nchar>&, integer&, const TNumberFormat<nchar>& );
444extern template ALIB_DLL uint64_t ParseOct <nchar>( const TString<nchar>&, integer&, const TNumberFormat<nchar>& );
445extern template ALIB_DLL double ParseFloat <nchar>( const TString<nchar>&, integer&, const TNumberFormat<nchar>& );
446extern template ALIB_DLL integer WriteDecUnsigned<nchar>( uint64_t, nchar*, integer, int, const TNumberFormat<nchar>& );
447extern template ALIB_DLL integer WriteDecSigned <nchar>( int64_t , nchar*, integer, int, const TNumberFormat<nchar>& );
448extern template ALIB_DLL integer WriteBin <nchar>( uint64_t, nchar*, integer, int, const TNumberFormat<nchar>& );
449extern template ALIB_DLL integer WriteHex <nchar>( uint64_t, nchar*, integer, int, const TNumberFormat<nchar>& );
450extern template ALIB_DLL integer WriteOct <nchar>( uint64_t, nchar*, integer, int, const TNumberFormat<nchar>& );
451extern template ALIB_DLL integer WriteFloat <nchar>( double , nchar*, integer, int, const TNumberFormat<nchar>& );
452
453extern template ALIB_DLL uint64_t ParseDecDigits <wchar>( const TString<wchar>&, integer& );
454extern template ALIB_DLL int64_t ParseInt <wchar>( const TString<wchar>&, integer&, const TNumberFormat<wchar>& );
455extern template ALIB_DLL uint64_t ParseDec <wchar>( const TString<wchar>&, integer&, const TNumberFormat<wchar>& );
456extern template ALIB_DLL uint64_t ParseBin <wchar>( const TString<wchar>&, integer&, const TNumberFormat<wchar>& );
457extern template ALIB_DLL uint64_t ParseHex <wchar>( const TString<wchar>&, integer&, const TNumberFormat<wchar>& );
458extern template ALIB_DLL uint64_t ParseOct <wchar>( const TString<wchar>&, integer&, const TNumberFormat<wchar>& );
459extern template ALIB_DLL double ParseFloat <wchar>( const TString<wchar>&, integer&, const TNumberFormat<wchar>& );
460extern template ALIB_DLL integer WriteDecUnsigned<wchar>( uint64_t, wchar*, integer, int, const TNumberFormat<wchar>& );
461extern template ALIB_DLL integer WriteDecSigned <wchar>( int64_t , wchar*, integer, int, const TNumberFormat<wchar>& );
462extern template ALIB_DLL integer WriteBin <wchar>( uint64_t, wchar*, integer, int, const TNumberFormat<wchar>& );
463extern template ALIB_DLL integer WriteHex <wchar>( uint64_t, wchar*, integer, int, const TNumberFormat<wchar>& );
464extern template ALIB_DLL integer WriteOct <wchar>( uint64_t, wchar*, integer, int, const TNumberFormat<wchar>& );
465extern template ALIB_DLL integer WriteFloat <wchar>( double , wchar*, integer, int, const TNumberFormat<wchar>& );
466
467extern template ALIB_DLL uint64_t ParseDecDigits <xchar>( const TString<xchar>&, integer& );
468extern template ALIB_DLL int64_t ParseInt <xchar>( const TString<xchar>&, integer&, const TNumberFormat<xchar>& );
469extern template ALIB_DLL uint64_t ParseDec <xchar>( const TString<xchar>&, integer&, const TNumberFormat<xchar>& );
470extern template ALIB_DLL uint64_t ParseBin <xchar>( const TString<xchar>&, integer&, const TNumberFormat<xchar>& );
471extern template ALIB_DLL uint64_t ParseHex <xchar>( const TString<xchar>&, integer&, const TNumberFormat<xchar>& );
472extern template ALIB_DLL uint64_t ParseOct <xchar>( const TString<xchar>&, integer&, const TNumberFormat<xchar>& );
473extern template ALIB_DLL double ParseFloat <xchar>( const TString<xchar>&, integer&, const TNumberFormat<xchar>& );
474extern template ALIB_DLL integer WriteDecUnsigned<xchar>( uint64_t, xchar*, integer, int, const TNumberFormat<xchar>& );
475extern template ALIB_DLL integer WriteDecSigned <xchar>( int64_t , xchar*, integer, int, const TNumberFormat<xchar>& );
476extern template ALIB_DLL integer WriteBin <xchar>( uint64_t, xchar*, integer, int, const TNumberFormat<xchar>& );
477extern template ALIB_DLL integer WriteHex <xchar>( uint64_t, xchar*, integer, int, const TNumberFormat<xchar>& );
478extern template ALIB_DLL integer WriteOct <xchar>( uint64_t, xchar*, integer, int, const TNumberFormat<xchar>& );
479extern template ALIB_DLL integer WriteFloat <xchar>( double , xchar*, integer, int, const TNumberFormat<xchar>& );
480#endif //!DOXYGEN
481
482
483}}} // namespace [alib::strings::detail]
#define ALIB_DLL
Definition alib.inl:573
#define ALIB_EXPORT
Definition alib.inl:562
This is a detail namespace of module ALib Strings.
uint64_t ParseOct(const TString< TChar > &src, integer &idx, const TNumberFormat< TChar > &nf)
uint64_t ParseHex(const TString< TChar > &src, integer &idx, const TNumberFormat< TChar > &nf)
integer WriteHex(uint64_t value, TChar *buffer, integer idx, int minWidth, const TNumberFormat< TChar > &nf)
int64_t ParseInt(const TString< TChar > &src, integer &idx, const TNumberFormat< TChar > &nf)
integer WriteDecUnsigned(uint64_t value, TChar *buffer, integer idx, int minWidth, const TNumberFormat< TChar > &nf)
uint64_t ParseDecDigits(const TString< TChar > &src, integer &idx)
integer WriteDecSigned(int64_t value, TChar *buffer, integer idx, int minWidth, const TNumberFormat< TChar > &nf)
double ParseFloat(const TString< TChar > &src, integer &idx, const TNumberFormat< TChar > &nf)
uint64_t ParseDec(const TString< TChar > &src, integer &idx, const TNumberFormat< TChar > &nf)
integer WriteOct(uint64_t value, TChar *buffer, integer idx, int minWidth, const TNumberFormat< TChar > &nf)
integer WriteBin(uint64_t value, TChar *buffer, integer idx, int minWidth, const TNumberFormat< TChar > &nf)
integer WriteFloat(double value, TChar *buffer, integer idx, int minWidth, const TNumberFormat< TChar > &nf)
uint64_t ParseBin(const TString< TChar > &src, integer &idx, 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.