aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/xml/document/xml-options.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 /library/cpp/xml/document/xml-options.h
downloadydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/cpp/xml/document/xml-options.h')
-rw-r--r--library/cpp/xml/document/xml-options.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/library/cpp/xml/document/xml-options.h b/library/cpp/xml/document/xml-options.h
new file mode 100644
index 0000000000..bb07da0cfb
--- /dev/null
+++ b/library/cpp/xml/document/xml-options.h
@@ -0,0 +1,67 @@
+#pragma once
+
+#include <contrib/libs/libxml/include/libxml/parser.h>
+
+namespace NXml {
+ enum class EOption : int {
+ // clang-format off
+ Recover = XML_PARSE_RECOVER,
+ NoEnt = XML_PARSE_NOENT,
+ DTDLoad = XML_PARSE_DTDLOAD,
+ DTDAttr = XML_PARSE_DTDATTR,
+ DTDValid = XML_PARSE_DTDVALID,
+ NoError = XML_PARSE_NOERROR,
+ NoWarning = XML_PARSE_NOWARNING,
+ Pedantic = XML_PARSE_PEDANTIC,
+ NoBlanks = XML_PARSE_NOBLANKS,
+ SAX1 = XML_PARSE_SAX1,
+ XInclude = XML_PARSE_XINCLUDE,
+ NoNet = XML_PARSE_NONET,
+ NoDict = XML_PARSE_NODICT,
+ NSClean = XML_PARSE_NSCLEAN,
+ NoCData = XML_PARSE_NOCDATA,
+ NoXInclude = XML_PARSE_NOXINCNODE,
+ Compact = XML_PARSE_COMPACT,
+ Old10 = XML_PARSE_OLD10,
+ NoBaseFix = XML_PARSE_NOBASEFIX,
+ Huge = XML_PARSE_HUGE,
+ OldSAX = XML_PARSE_OLDSAX,
+ IgnoreEnc = XML_PARSE_IGNORE_ENC,
+ BigLines = XML_PARSE_BIG_LINES,
+ // clang-format on
+ };
+
+ class TOptions {
+ public:
+ TOptions()
+ : Mask(0)
+ {
+ }
+
+ template <typename... TArgs>
+ TOptions(TArgs... args)
+ : Mask(0)
+ {
+ Set(args...);
+ }
+
+ TOptions& Set(EOption option) {
+ Mask |= static_cast<int>(option);
+ return *this;
+ }
+
+ template <typename... TArgs>
+ TOptions& Set(EOption arg, TArgs... args) {
+ Set(arg);
+ return Set(args...);
+ }
+
+ int GetMask() const {
+ return Mask;
+ }
+
+ private:
+ int Mask;
+ };
+
+}