TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
gui_numeric_text.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <cstdint>
6#include <string>
7#include <string_view>
8
9namespace tachyon
10{
13
14 // Numbers as the text a field shows and edits.
15
17 std::string FormatNumber(NumericType type, const NumericValue& value);
19 bool ParseNumber(std::string_view text, NumericType type, NumericValue& outValue);
22 bool FilterNumberText(NumericType type, std::string& text);
24 bool IsNumberCharacter(NumericType type, uint32_t codepoint);
26}
std::string FormatNumber(NumericType type, const NumericValue &value)
value as text; floats use up to 9 significant digits, NaN and infinities spelled out.
NumericType
Definition gui_numeric_type.h:15
bool FilterNumberText(NumericType type, std::string &text)
Strips what a number of type can't hold (letters, a second dot, ...).
bool ParseNumber(std::string_view text, NumericType type, NumericValue &outValue)
The whole text as a number of type: in range and, for floats, finite.
bool IsNumberCharacter(NumericType type, uint32_t codepoint)
Whether codepoint can be typed into a number of type.
Definition gui_logging.h:24
Definition gui_numeric_type.h:37