diff options
author | Mariano Javier Suligoy <marianognu.easyrpg@gmail.com> | 2015-08-03 17:28:33 -0300 |
---|---|---|
committer | Mariano Javier Suligoy <marianognu.easyrpg@gmail.com> | 2015-08-03 17:28:33 -0300 |
commit | c88038228ae9b5c53d5d7ff3f1d99ac0adbc30eb (patch) | |
tree | 8df611ec64e5f58d32e09512bac9d1f5a662403d /drivers/nrex/regex.h | |
parent | d7279ddaf2aa98ed962d84d466f21dc2f39522c9 (diff) | |
parent | cbee679bd78c1b3317db1ea4e349f278576304a1 (diff) |
Merge branch 'master' of https://github.com/okamstudio/godot
Diffstat (limited to 'drivers/nrex/regex.h')
-rw-r--r-- | drivers/nrex/regex.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/drivers/nrex/regex.h b/drivers/nrex/regex.h new file mode 100644 index 0000000000..0626029705 --- /dev/null +++ b/drivers/nrex/regex.h @@ -0,0 +1,47 @@ +/*************************************************/ +/* regex.h */ +/*************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/*************************************************/ +/* Source code within this file is: */ +/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* All Rights Reserved. */ +/*************************************************/ + +#ifndef REGEX_H +#define REGEX_H + +#include "ustring.h" +#include "vector.h" +#include "core/reference.h" +#include "nrex.hpp" + +class RegEx : public Reference { + + OBJ_TYPE(RegEx, Reference); + + mutable String text; + mutable Vector<nrex_result> captures; + nrex exp; + +protected: + + static void _bind_methods(); + StringArray _bind_get_captures() const; + +public: + + void clear(); + bool is_valid() const; + int get_capture_count() const; + String get_capture(int capture) const; + Error compile(const String& p_pattern); + int find(const String& p_text, int p_start = 0, int p_end = -1) const; + + RegEx(); + RegEx(const String& p_pattern); + ~RegEx(); +}; + +#endif // REGEX_H |