|
@@ -5,7 +5,10 @@
|
|
|
|
|
|
#include <google/protobuf/repeated_field.h>
|
|
|
|
|
|
+#include <library/cpp/iterator/mapped.h>
|
|
|
+#include <util/generic/string.h>
|
|
|
#include <util/generic/vector.h>
|
|
|
+#include <util/string/join.h>
|
|
|
|
|
|
namespace NFq {
|
|
|
|
|
@@ -22,4 +25,25 @@ TVector<TElement> VectorFromProto(const ::google::protobuf::RepeatedPtrField<TEl
|
|
|
return { field.begin(), field.end() };
|
|
|
}
|
|
|
|
|
|
+template <typename TIter, typename TFunc>
|
|
|
+TString JoinMapRange(TString delim, const TIter beg, const TIter end, const TFunc func) {
|
|
|
+ auto mappedBegin =
|
|
|
+ MakeMappedIterator(beg, func);
|
|
|
+ auto mappedEnd =
|
|
|
+ MakeMappedIterator(end, func);
|
|
|
+ return JoinRange(delim, mappedBegin, mappedEnd);
|
|
|
+}
|
|
|
+
|
|
|
+TString EscapeString(const TString& value,
|
|
|
+ const TString& enclosingSeq,
|
|
|
+ const TString& replaceWith);
|
|
|
+
|
|
|
+TString EscapeString(const TString& value, char enclosingChar);
|
|
|
+
|
|
|
+TString EncloseAndEscapeString(const TString& value, char enclosingChar);
|
|
|
+
|
|
|
+TString EncloseAndEscapeString(const TString& value,
|
|
|
+ const TString& enclosingSeq,
|
|
|
+ const TString& replaceWith);
|
|
|
+
|
|
|
} // namespace NFq
|