aboutsummaryrefslogtreecommitdiff
path: root/drivers/nrex/regex.h
diff options
context:
space:
mode:
authorLee Zher Huei2015-07-24 01:18:46 +0100
committerLee Zher Huei2015-07-24 01:18:46 +0100
commitef005d4f64d2ee2b35185d4fbdf2aea684cd4966 (patch)
tree5653f85ff2761b5b26dc814b135858dc668954b3 /drivers/nrex/regex.h
parentf697ec2fe022583dde5f3ae650f49cfd7f237c33 (diff)
downloadgodot-ef005d4f64d2ee2b35185d4fbdf2aea684cd4966.tar.gz
godot-ef005d4f64d2ee2b35185d4fbdf2aea684cd4966.tar.zst
godot-ef005d4f64d2ee2b35185d4fbdf2aea684cd4966.zip
Diffstat (limited to 'drivers/nrex/regex.h')
-rw-r--r--drivers/nrex/regex.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/drivers/nrex/regex.h b/drivers/nrex/regex.h
new file mode 100644
index 000000000..3ef9ca342
--- /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_capture_list() 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);
+ bool match(const String& p_text, int p_start = 0, int p_end = -1) const;
+
+ RegEx();
+ RegEx(const String& p_pattern);
+ ~RegEx();
+};
+
+#endif // REGEX_H