Audacity 3.2.0
ToChars.h
Go to the documentation of this file.
1/*!********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file ToChars.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 ToCharsResult final
17{
18 char* ptr;
19 std::errc ec;
20};
21
23STRING_UTILS_API ToCharsResult ToChars(
24 char* buffer, char* last, float value,
25 int digitsAfterDecimalPoint = -1) noexcept;
26
28STRING_UTILS_API ToCharsResult ToChars(
29 char* buffer, char* last, double value,
30 int digitsAfterDecimalPoint = -1) noexcept;
31
33STRING_UTILS_API ToCharsResult ToChars(char* buffer, char* last, long long value) noexcept;
35STRING_UTILS_API ToCharsResult ToChars(char* buffer, char* last, unsigned long long value) noexcept;
STRING_UTILS_API ToCharsResult ToChars(char *buffer, char *last, float value, int digitsAfterDecimalPoint=-1) noexcept
Convert a single precision floating point number to a string, always uses the dot as decimal.
Definition: ToChars.cpp:1225
Result of the conversion, similar to std::to_chars_result.
Definition: ToChars.h:17
char * ptr
Definition: ToChars.h:18
std::errc ec
A pointer to the last updated character, or last on failure.
Definition: ToChars.h:19