Audacity 3.2.0
FromChars.h
Go to the documentation of this file.
1/*!********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file FromChars.h
6 @brief Declare functions to convert numeric types to string representation.
7
8 Dmitry Vedenko
9 **********************************************************************/
10
11#pragma once
12
13#include <system_error>
14
16struct STRING_UTILS_API FromCharsResult final
17{
18 const char* ptr;
19
23 std::errc ec;
24};
25
27STRING_UTILS_API FromCharsResult FromChars(const char* buffer, const char* last, float& value) noexcept;
28
30STRING_UTILS_API FromCharsResult FromChars(const char* buffer, const char* last, double& value) noexcept;
31
33STRING_UTILS_API FromCharsResult FromChars(const char* buffer, const char* last, short& value) noexcept;
35STRING_UTILS_API FromCharsResult FromChars(const char* buffer, const char* last, unsigned short& value) noexcept;
36
38STRING_UTILS_API FromCharsResult FromChars(const char* buffer, const char* last, int& value) noexcept;
40STRING_UTILS_API FromCharsResult FromChars(const char* buffer, const char* last, unsigned int& value) noexcept;
41
43STRING_UTILS_API FromCharsResult FromChars(const char* buffer, const char* last, long& value) noexcept;
45STRING_UTILS_API FromCharsResult FromChars(const char* buffer, const char* last, unsigned long& value) noexcept;
46
48STRING_UTILS_API FromCharsResult FromChars(const char* buffer, const char* last, long long& value) noexcept;
50STRING_UTILS_API FromCharsResult FromChars(const char* buffer, const char* last, unsigned long long& value) noexcept;
52STRING_UTILS_API FromCharsResult FromChars(const char* buffer, const char* last, bool& value) noexcept;
STRING_UTILS_API FromCharsResult FromChars(const char *buffer, const char *last, float &value) noexcept
Parse a string into a single precision floating point value, always uses the dot as decimal.
Definition: FromChars.cpp:153
Result of the conversion, similar to std::from_chars_result.
Definition: FromChars.h:17
const char * ptr
Definition: FromChars.h:18
std::errc ec
A pointer to the first character not matching the pattern.
Definition: FromChars.h:23