aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/poco/Foundation/include/Poco/JSONString.h
diff options
context:
space:
mode:
authorDevtools Arcadia <arcadia-devtools@yandex-team.ru>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /contrib/libs/poco/Foundation/include/Poco/JSONString.h
downloadydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'contrib/libs/poco/Foundation/include/Poco/JSONString.h')
-rw-r--r--contrib/libs/poco/Foundation/include/Poco/JSONString.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/contrib/libs/poco/Foundation/include/Poco/JSONString.h b/contrib/libs/poco/Foundation/include/Poco/JSONString.h
new file mode 100644
index 0000000000..b4446efce7
--- /dev/null
+++ b/contrib/libs/poco/Foundation/include/Poco/JSONString.h
@@ -0,0 +1,93 @@
+//
+// JSONString.h
+//
+// Library: Foundation
+// Package: Core
+// Module: String
+//
+// JSONString utility functions.
+//
+// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier: BSL-1.0
+//
+
+
+#ifndef Foundation_JSONString_INCLUDED
+#define Foundation_JSONString_INCLUDED
+
+
+#include "Poco/Foundation.h"
+
+
+namespace Poco {
+
+
+enum JSONOptions
+{
+ JSON_PRESERVE_KEY_ORDER = 1,
+ /// Applies to JSON::Object. If specified, the Object will
+ /// preserve the items insertion order. Otherwise, items
+ /// will be sorted by keys.
+ ///
+ /// Has no effect on toJSON() function.
+
+ JSON_ESCAPE_UNICODE = 2,
+ /// If specified, when the object is stringified, all
+ /// unicode characters will be escaped in the resulting
+ /// string.
+
+ JSON_WRAP_STRINGS = 4
+ /// If specified, the object will preserve the items
+ /// insertion order. Otherwise, items will be sorted
+ /// by keys.
+ };
+
+
+//@ deprecated
+void Foundation_API toJSON(const std::string& value, std::ostream& out, bool wrap = true);
+ /// Formats string value into the supplied output stream by
+ /// escaping control and ALL Unicode characters.
+ /// If wrap is true, the resulting string is enclosed in double quotes.
+ ///
+ /// This function is deprecated, please use
+ ///
+ /// void Poco::toJSON(const std::string&, std::ostream&, int)
+
+
+//@ deprecated
+std::string Foundation_API toJSON(const std::string& value, bool wrap = true);
+ /// Formats string value by escaping control and ALL Unicode characters.
+ /// If wrap is true, the resulting string is enclosed in double quotes
+ ///
+ /// Returns formatted string.
+ ///
+ /// This function is deprecated, please use
+ ///
+ /// std::string Poco::toJSON(const std::string&, int)
+
+
+void Foundation_API toJSON(const std::string& value, std::ostream& out, int options);
+ /// Formats string value into the supplied output stream by
+ /// escaping control characters.
+ /// If JSON_WRAP_STRINGS is in options, the resulting strings is enclosed in double quotes
+ /// If JSON_ESCAPE_UNICODE is in options, all unicode characters will be escaped, otherwise
+ /// only the compulsory ones.
+
+
+std::string Foundation_API toJSON(const std::string& value, int options);
+ /// Formats string value by escaping control characters.
+ /// If JSON_WRAP_STRINGS is in options, the resulting string is enclosed in double quotes
+ /// If JSON_ESCAPE_UNICODE is in options, all unicode characters will be escaped, otherwise
+ /// only the compulsory ones.
+ ///
+ /// Returns formatted string.
+ /// If escapeAllUnicode is true, all unicode characters will be escaped, otherwise only the compulsory ones.
+
+
+
+} // namespace Poco
+
+
+#endif // Foundation_JSONString_INCLUDED