MCPcopy Create free account
hub / github.com/aenu1/aps3e / try_to_string

Function try_to_string

app/src/main/cpp/rpcs3/Utilities/Config.cpp:203–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203bool try_to_string(std::string* out, const f64& value)
204{
205#ifdef __APPLE__
206 if (out) *out = std::to_string(value);
207 return true;
208#else
209 std::array<char, 32> str{};
210
211 if (auto [ptr, ec] = std::to_chars(str.data(), str.data() + str.size(), value, std::chars_format::fixed); ec == std::errc())
212 {
213 if (out) *out = std::string(str.data(), ptr);
214 return true;
215 }
216 else
217 {
218 if (out) cfg_log.error("cfg::try_to_string(): could not convert value '%f' to string. error='%s'", value, std::make_error_code(ec).message());
219 return false;
220 }
221#endif
222}
223
224bool cfg::try_to_enum_value(u64* out, decltype(&fmt_class_string<int>::format) func, std::string_view value)
225{

Callers 2

to_stringMethod · 0.85
def_to_stringMethod · 0.85

Calls 8

errcEnum · 0.85
to_stringFunction · 0.70
stringClass · 0.70
dataMethod · 0.65
make_error_codeFunction · 0.50
sizeMethod · 0.45
errorMethod · 0.45
messageMethod · 0.45

Tested by

no test coverage detected