summaryrefslogtreecommitdiffstats
path: root/external_libs/yaml-cpp/src/regex.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-08-30 11:41:42 +0300
committerimarom <imarom@cisco.com>2015-08-30 11:41:42 +0300
commitc9381643e7bf9b3dc690bf3e012ad6176ee32b8c (patch)
treeff0e91ee5c38f2caaeaa53340ecf2db2a326455a /external_libs/yaml-cpp/src/regex.cpp
parent05a529031e962d61ab977393fb3d153931feff34 (diff)
parent53f0e28d7f30c7175cbb15884c309613593859d8 (diff)
Merge branch 'master' into rpc
Conflicts: linux/ws_main.py linux_dpdk/ws_main.py
Diffstat (limited to 'external_libs/yaml-cpp/src/regex.cpp')
-rw-r--r--external_libs/yaml-cpp/src/regex.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/external_libs/yaml-cpp/src/regex.cpp b/external_libs/yaml-cpp/src/regex.cpp
new file mode 100644
index 00000000..b35b1f43
--- /dev/null
+++ b/external_libs/yaml-cpp/src/regex.cpp
@@ -0,0 +1,60 @@
+#include "regex.h"
+
+namespace YAML
+{
+ // constructors
+ RegEx::RegEx(): m_op(REGEX_EMPTY)
+ {
+ }
+
+ RegEx::RegEx(REGEX_OP op): m_op(op)
+ {
+ }
+
+ RegEx::RegEx(char ch): m_op(REGEX_MATCH), m_a(ch)
+ {
+ }
+
+ RegEx::RegEx(char a, char z): m_op(REGEX_RANGE), m_a(a), m_z(z)
+ {
+ }
+
+ RegEx::RegEx(const std::string& str, REGEX_OP op): m_op(op)
+ {
+ for(std::size_t i=0;i<str.size();i++)
+ m_params.push_back(RegEx(str[i]));
+ }
+
+ // combination constructors
+ RegEx operator ! (const RegEx& ex)
+ {
+ RegEx ret(REGEX_NOT);
+ ret.m_params.push_back(ex);
+ return ret;
+ }
+
+ RegEx operator || (const RegEx& ex1, const RegEx& ex2)
+ {
+ RegEx ret(REGEX_OR);
+ ret.m_params.push_back(ex1);
+ ret.m_params.push_back(ex2);
+ return ret;
+ }
+
+ RegEx operator && (const RegEx& ex1, const RegEx& ex2)
+ {
+ RegEx ret(REGEX_AND);
+ ret.m_params.push_back(ex1);
+ ret.m_params.push_back(ex2);
+ return ret;
+ }
+
+ RegEx operator + (const RegEx& ex1, const RegEx& ex2)
+ {
+ RegEx ret(REGEX_SEQ);
+ ret.m_params.push_back(ex1);
+ ret.m_params.push_back(ex2);
+ return ret;
+ }
+}
+