#include "src/base/SkStringView.h"
#include "src/sksl/SkSLDefines.h"
#include "src/sksl/SkSLString.h"
#include <cerrno>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <locale>
#include <memory>
#include <sstream>
#include <string>
#include <string_view>
Go to the source code of this file.
|
template<typename RoundtripType , int kFullPrecision> |
static std::string | to_string_impl (RoundtripType value) |
|
◆ BUFFER_SIZE
◆ to_string_impl()
template<typename RoundtripType ,
int kFullPrecision>
static std::string to_string_impl |
( |
RoundtripType |
value | ) |
|
|
static |
Definition at line 23 of file SkSLString.cpp.
23 {
25 buffer.imbue(std::locale::classic());
29
30 double roundtripped;
32 if (value != (RoundtripType)roundtripped && std::isfinite(value)) {
35 buffer.precision(kFullPrecision);
38 SkASSERTF((
buffer >> roundtripped, value == (RoundtripType)roundtripped),
39 "%.17g -> %s -> %.17g", value,
text.c_str(), roundtripped);
40 }
41
42
45 }
46
48}
#define SkASSERTF(cond, fmt,...)
static const uint8_t buffer[]
constexpr bool contains(std::string_view str, std::string_view needle)