18 #define FOLLY_STRING_H_ 23 #include <unordered_map> 24 #include <unordered_set> 73 template <
class String>
79 template <
class String>
100 template <
class String>
106 template <
class String>
127 template <
class String>
136 template <
class String>
149 template <
class String>
158 template <
class String>
212 template <
class OutputString>
215 OutputString& output,
216 bool hex_style =
false);
218 template <
class OutputString = std::
string>
236 template <
class String1,
class String2>
237 void humanify(
const String1& input, String2& output);
239 template <
class String>
253 template <
class InputString,
class OutputString>
255 const InputString& input,
256 OutputString& output,
259 template <
class OutputString = std::
string>
264 throw std::runtime_error(
"hexlify failed");
269 template <
class OutputString = std::
string>
271 return hexlify<OutputString>(
ByteRange{input});
278 template <
class InputString,
class OutputString>
279 bool unhexlify(
const InputString& input, OutputString& output);
281 template <
class OutputString = std::
string>
287 throw std::domain_error(
"unhexlify() called with non-hex input");
375 template <
class OutIt>
419 template <
class Delim,
class String,
class OutputType>
421 const Delim& delimiter,
423 std::vector<OutputType>& out,
424 const bool ignoreEmpty =
false);
426 template <
class Delim,
class String,
class OutputType>
428 const Delim& delimiter,
431 const bool ignoreEmpty =
false);
434 class OutputValueType,
437 class OutputIterator>
439 const Delim& delimiter,
442 const bool ignoreEmpty =
false);
479 template <
typename Vo
id,
typename OutputType>
485 template <
typename OutputType>
490 template <
typename OutputType>
493 template <
bool exact =
true,
class Delim,
class... OutputTypes>
494 typename std::enable_if<
496 sizeof...(OutputTypes) >= 1,
507 template <
class Delim,
class Iterator,
class String>
508 void join(
const Delim& delimiter, Iterator
begin, Iterator
end, String& output);
510 template <
class Delim,
class Container,
class String>
511 void join(
const Delim& delimiter,
const Container& container, String& output) {
512 join(delimiter, container.begin(), container.end(),
output);
515 template <
class Delim,
class Value,
class String>
517 const Delim& delimiter,
518 const std::initializer_list<Value>&
values,
520 join(delimiter, values.begin(), values.end(),
output);
523 template <
class Delim,
class Container>
526 join(delimiter, container.begin(), container.end(),
output);
530 template <
class Delim,
class Value>
532 const Delim& delimiter,
533 const std::initializer_list<Value>&
values) {
535 join(delimiter, values.begin(), values.end(),
output);
542 typename std::enable_if<std::is_base_of<
543 std::forward_iterator_tag,
544 typename std::iterator_traits<Iterator>::iterator_category>
::value>
:: 548 join(delimiter, begin, end, output);
StringPiece ltrimWhitespace(StringPiece sp)
void splitTo(const Delim &delimiter, const String &input, OutputIterator out, bool ignoreEmpty)
bool unhexlify(const InputString &input, OutputString &output)
#define FOLLY_PRINTF_FORMAT
void uriUnescape(StringPiece str, String &out, UriEscapeMode mode)
StringPiece skipWhitespace(StringPiece sp)
constexpr detail::Map< Move > move
std::string stringVPrintf(const char *format, va_list ap)
void append(std::unique_ptr< IOBuf > &buf, StringPiece str)
constexpr size_type size() const
auto begin(TestAdlIterable &instance)
std::string stringPrintf(const char *format,...)
std::string & stringVAppendf(std::string *output, const char *format, va_list ap)
void humanify(const String1 &input, String2 &output)
FOLLY_NODISCARD std::enable_if< std::is_arithmetic< Tgt >::value, Expected< StringPiece, ConversionCode > >::type parseTo(StringPiece src, Tgt &out)
—— Concurrent Priority Queue Implementation ——
std::string toStdString(const folly::fbstring &s)
void split(const Delim &delimiter, const String &input, std::vector< OutputType > &out, bool ignoreEmpty)
bool_constant< true > true_type
std::string prettyPrint(double val, PrettyType type, bool addSpace)
std::string stripLeftMargin(std::string s)
folly::Optional< PskKeyExchangeMode > mode
constexpr auto size(C const &c) -> decltype(c.size())
const value_type * data() const
auto end(TestAdlIterable &instance)
void uriEscape(StringPiece str, String &out, UriEscapeMode mode)
void cUnescape(StringPiece str, String &out, bool strict)
StringPiece rtrimWhitespace(StringPiece sp)
void hexDump(const void *ptr, size_t size, OutIt out)
type_t< void, Ts... > void_t
std::string & stringAppendf(std::string *output, const char *format,...)
fbstring errnoStr(int err)
double prettyToDouble(folly::StringPiece *const prettyString, const PrettyType type)
constexpr Iter begin() const
void toLowerAscii(char *str, size_t length)
void backslashify(folly::StringPiece input, OutputString &output, bool hex_style)
StringPiece trimWhitespace(StringPiece sp)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
bool_constant< false > false_type
void join(const Delim &delimiter, Iterator begin, Iterator end, String &output)
Formatter< false, Args... > format(StringPiece fmt, Args &&...args)
#define FOLLY_PRINTF_FORMAT_ATTR(format_param, dots_param)
bool hexlify(const InputString &input, OutputString &output, bool append_output)
std::vector< int > values(1'000)
void cEscape(StringPiece str, String &out)