virtualx-engine/drivers/nrex/regex.h

48 lines
1.1 KiB
C
Raw Normal View History

2014-02-10 02:10:30 +01:00
/*************************************************/
/* 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"
2015-07-24 02:18:46 +02:00
#include "vector.h"
2014-02-10 02:10:30 +01:00
#include "core/reference.h"
2015-07-24 02:18:46 +02:00
#include "nrex.hpp"
2014-02-10 02:10:30 +01:00
class RegEx : public Reference {
OBJ_TYPE(RegEx, Reference);
mutable String text;
2015-07-24 02:18:46 +02:00
mutable Vector<nrex_result> captures;
nrex exp;
2014-02-10 02:10:30 +01:00
protected:
static void _bind_methods();
2015-07-24 15:09:39 +02:00
StringArray _bind_get_captures() const;
2014-02-10 02:10:30 +01:00
public:
void clear();
bool is_valid() const;
int get_capture_count() const;
2015-07-24 02:18:46 +02:00
String get_capture(int capture) const;
Error compile(const String& p_pattern);
2015-07-24 15:09:39 +02:00
int find(const String& p_text, int p_start = 0, int p_end = -1) const;
2014-02-10 02:10:30 +01:00
RegEx();
RegEx(const String& p_pattern);
~RegEx();
};
#endif // REGEX_H