mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Refactored common scalar scanning code (from plain, quoted, and block) to one function.
This commit is contained in:
8
regex.h
8
regex.h
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
enum REGEX_OP { REGEX_EMPTY, REGEX_MATCH, REGEX_RANGE, REGEX_OR, REGEX_NOT, REGEX_SEQ };
|
||||
enum REGEX_OP { REGEX_EMPTY, REGEX_MATCH, REGEX_RANGE, REGEX_OR, REGEX_AND, REGEX_NOT, REGEX_SEQ };
|
||||
|
||||
// simplified regular expressions
|
||||
// . Only straightforward matches (no repeated characters)
|
||||
@@ -35,6 +35,11 @@ namespace YAML
|
||||
virtual int Match(std::istream& in, const RegEx& regex) const;
|
||||
};
|
||||
|
||||
struct AndOperator: public Operator {
|
||||
virtual int Match(const std::string& str, const RegEx& regex) const;
|
||||
virtual int Match(std::istream& in, const RegEx& regex) const;
|
||||
};
|
||||
|
||||
struct NotOperator: public Operator {
|
||||
virtual int Match(const std::string& str, const RegEx& regex) const;
|
||||
virtual int Match(std::istream& in, const RegEx& regex) const;
|
||||
@@ -63,6 +68,7 @@ namespace YAML
|
||||
|
||||
friend RegEx operator ! (const RegEx& ex);
|
||||
friend RegEx operator || (const RegEx& ex1, const RegEx& ex2);
|
||||
friend RegEx operator && (const RegEx& ex1, const RegEx& ex2);
|
||||
friend RegEx operator + (const RegEx& ex1, const RegEx& ex2);
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user