scide: implement selectionLength for openDocument
[supercollider.git] / external_libraries / yaml-cpp-0.3.0 / src / regex.cpp
blobb35b1f43354d368898c41e8cb6a8ea81c55d0358
1 #include "regex.h"
3 namespace YAML
5 // constructors
6 RegEx::RegEx(): m_op(REGEX_EMPTY)
10 RegEx::RegEx(REGEX_OP op): m_op(op)
14 RegEx::RegEx(char ch): m_op(REGEX_MATCH), m_a(ch)
18 RegEx::RegEx(char a, char z): m_op(REGEX_RANGE), m_a(a), m_z(z)
22 RegEx::RegEx(const std::string& str, REGEX_OP op): m_op(op)
24 for(std::size_t i=0;i<str.size();i++)
25 m_params.push_back(RegEx(str[i]));
28 // combination constructors
29 RegEx operator ! (const RegEx& ex)
31 RegEx ret(REGEX_NOT);
32 ret.m_params.push_back(ex);
33 return ret;
36 RegEx operator || (const RegEx& ex1, const RegEx& ex2)
38 RegEx ret(REGEX_OR);
39 ret.m_params.push_back(ex1);
40 ret.m_params.push_back(ex2);
41 return ret;
44 RegEx operator && (const RegEx& ex1, const RegEx& ex2)
46 RegEx ret(REGEX_AND);
47 ret.m_params.push_back(ex1);
48 ret.m_params.push_back(ex2);
49 return ret;
52 RegEx operator + (const RegEx& ex1, const RegEx& ex2)
54 RegEx ret(REGEX_SEQ);
55 ret.m_params.push_back(ex1);
56 ret.m_params.push_back(ex2);
57 return ret;