namespace folly {
namespace detail {
-extern const char digit1[101] =
- "00000000001111111111222222222233333333334444444444"
- "55555555556666666666777777777788888888889999999999";
-extern const char digit2[101] =
- "01234567890123456789012345678901234567890123456789"
- "01234567890123456789012345678901234567890123456789";
-
-template <> const char *const MaxString<bool>::value = "true";
+namespace {
+
+// Maximum value of number when represented as a string
+template <class T>
+struct MaxString {
+ static const char* const value;
+};
+
template <> const char *const MaxString<uint8_t>::value = "255";
template <> const char *const MaxString<uint16_t>::value = "65535";
template <> const char *const MaxString<uint32_t>::value = "4294967295";
"340282366920938463463374607431768211455";
#endif
-namespace {
/*
* Lookup tables that converts from a decimal character value to an integral
* binary value, shifted by a decimal "shift" multiplier.
#pragma once
-#include <folly/FBString.h>
-#include <folly/Likely.h>
-#include <folly/Preprocessor.h>
-#include <folly/Range.h>
-
-#include <boost/implicit_cast.hpp>
#include <algorithm>
-#include <type_traits>
+#include <climits>
+#include <cstddef>
#include <limits>
+#include <stdexcept>
#include <string>
#include <tuple>
-#include <stdexcept>
+#include <type_traits>
#include <typeinfo>
+#include <utility>
-#include <limits.h>
+#include <boost/implicit_cast.hpp>
+#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
-// V8 JavaScript implementation
-#include <double-conversion/double-conversion.h>
+#include <folly/FBString.h>
+#include <folly/Likely.h>
+#include <folly/Preprocessor.h>
+#include <folly/Range.h>
#define FOLLY_RANGE_CHECK_STRINGIZE(x) #x
#define FOLLY_RANGE_CHECK_STRINGIZE2(x) FOLLY_RANGE_CHECK_STRINGIZE(x)
return b;
}
- // Maximum value of number when represented as a string
- template <class T> struct MaxString {
- static const char*const value;
- };
bool str_to_bool(StringPiece* src);
float str_to_float(StringPiece* src);