18 #define FOLLY_GEN_STRING_H_ 28 class StringResplitter;
30 template <
class Delimiter>
31 class SplitStringSource;
33 template <
class Delimiter,
class Output>
36 template <
class Delimiter,
class OutputBuffer>
39 template <
class TargetContainer,
class Delimiter,
class... Targets>
55 template <
class S = detail::StringResplitter>
56 S
resplit(
char delimiter,
bool keepDelimiter =
false) {
57 return S(delimiter, keepDelimiter);
60 template <
class S = detail::SplitStringSource<
char>>
62 return S(source, delimiter);
65 template <
class S = detail::SplitStringSource<StringPiece>>
67 return S(source, delimiter);
79 template <
class S = detail::SplitStringSource<MixedNewlines>>
102 return Unsplit(delimiter);
109 return Unsplit(delimiter);
130 UnsplitBuffer
unsplit(Delimiter delimiter, OutputBuffer* outputBuffer) {
131 return UnsplitBuffer(delimiter, outputBuffer);
137 UnsplitBuffer
unsplit(
const char* delimiter, OutputBuffer* outputBuffer) {
138 return UnsplitBuffer(delimiter, outputBuffer);
141 template <
class... Targets>
148 template <
class... Targets>
156 template <
class First,
class Second>
161 detail::SplitTo<std::pair<First, Second>, char, First, Second>(delim));
164 template <
class First,
class Second>
169 detail::SplitTo<std::pair<First, Second>,
fbstring, First, Second>(
170 to<fbstring>(delim)));
195 template <
class Callback>
204 delimiter_(delimiter),
205 maxLength_(maxLength),
206 pieceCb_(
std::
move(pieceCb)) {}
237 template <
class Callback>
detail::Map< detail::SplitTo< std::pair< First, Second >, char, First, Second > > eachToPair(char delim)
S resplit(char delimiter, bool keepDelimiter=false)
constexpr detail::Map< Move > move
—— Concurrent Priority Queue Implementation ——
StreamSplitter(char delimiter, Callback &&pieceCb, uint64_t maxLength=0, uint64_t initialCapacity=0)
S split(const StringPiece source, char delimiter)
S lines(StringPiece source)
StreamSplitter< Callback > streamSplitter(char delimiter, Callback &&pieceCb, uint64_t capacity=0)
Unsplit unsplit(const Delimiter &delimiter)
basic_fbstring< char > fbstring
std::unique_ptr< unsigned char[]> buffer_
detail::Map< detail::SplitTo< std::tuple< Targets... >, char, Targets... > > eachToTuple(char delim)