from_chars.h
Go to the documentation of this file.
1 #pragma once
2 
11 #include <string>
12 #include <system_error>
13 
14 namespace cras
15 {
16 
18 {
19  scientific = 1 << 0,
20  fixed = 1 << 2,
21  hex = 1 << 3,
23 };
24 
26 {
27  const char* ptr;
28  ::std::errc ec;
29 };
30 
44 ::cras::from_chars_result from_chars(const char* first, const char* last, float& value,
46 
60 ::cras::from_chars_result from_chars(const char* first, const char* last, double& value,
62 
75 inline ::cras::from_chars_result from_chars(const ::std::string& string, float& value,
77 {
78  return ::cras::from_chars(string.data(), string.data() + string.size(), value, fmt);
79 }
80 
93 inline ::cras::from_chars_result from_chars(const ::std::string& string, double& value,
95 {
96  return ::cras::from_chars(string.data(), string.data() + string.size(), value, fmt);
97 }
98 
99 }
inline ::cras::from_chars_result from_chars(const ::std::string &string, double &value, ::cras::chars_format fmt=::cras::chars_format::general) noexcept
Convert the given string to its best double representation. The behavior is similar to std::from_char...
Definition: from_chars.h:93
data
Definition: any.hpp:15
chars_format
Definition: from_chars.h:17
::cras::from_chars_result from_chars(const char *first, const char *last, float &value, ::cras::chars_format fmt=::cras::chars_format::general) noexcept
Convert the given string to its best float representation. The behavior is similar to std::from_chars...


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Sat Jun 17 2023 02:32:53