Searched refs:Radix (Results 1 – 5 of 5) sorted by relevance
/frameworks/native/include/ftl/ |
D | string.h | 28 enum class Radix { kBin = 2, kDec = 10, kHex = 16 }; enum 54 std::string_view to_chars(char (&buffer)[N], T v, Radix radix = Radix::kDec) { 61 if (radix == Radix::kDec) { 66 const auto prefix = radix == Radix::kBin ? 'b' : 'x'; 93 inline std::string to_string(T v, Radix radix = Radix::kDec) { 99 std::string to_string(bool, Radix) = delete;
|
D | flags.h | 186 constexpr auto radix = sizeof(U) == 1 ? Radix::kBin : Radix::kHex; in string()
|
D | enum.h | 362 constexpr auto radix = sizeof(E) == 1 ? Radix::kBin : Radix::kHex;
|
/frameworks/native/libs/ftl/ |
D | string_test.cpp | 34 EXPECT_EQ(ftl::to_chars(buffer, -42, ftl::Radix::kBin), "-0b101010"); in TEST() 35 EXPECT_EQ(ftl::to_chars(buffer, 0xcafe, ftl::Radix::kHex), "0xcafe"); in TEST() 36 EXPECT_EQ(ftl::to_chars(buffer, '*', ftl::Radix::kHex), "0x2a"); in TEST() 91 static constexpr auto kRadix = ftl::Radix::kBin; 116 static constexpr auto kRadix = ftl::Radix::kDec; 125 static constexpr auto kRadix = ftl::Radix::kHex; 149 EXPECT_EQ(ftl::to_chars(buffer, x, ftl::Radix::kBin), "0b11111111"); in TEST() 154 EXPECT_EQ(ftl::to_chars(buffer, x, ftl::Radix::kBin), "-0b1000000000000000"); in TEST() 179 EXPECT_EQ(ftl::to_chars(buffer, x, ftl::Radix::kHex), "0xfade"); in TEST() 183 EXPECT_EQ(ftl::to_chars(buffer, INT64_MIN, ftl::Radix::kHex), "-0x8000000000000000"); in TEST()
|
D | optional_test.cpp | 68 EXPECT_EQ("0b100"s, Optional(4).transform(std::bind(ftl::to_string<int>, _1, ftl::Radix::kBin))); in TEST()
|