virtualx-engine/drivers/nrex/regex.h

48 lines
1.2 KiB
C
Raw Normal View History

2014-02-09 22:10:30 -03:00
/*************************************************/
/* regex.h */
/*************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/*************************************************/
/* Source code within this file is: */
2016-01-01 11:50:53 -02:00
/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */
2014-02-09 22:10:30 -03:00
/* All Rights Reserved. */
/*************************************************/
#ifndef REGEX_H
#define REGEX_H
#include "ustring.h"
2015-07-24 01:18:46 +01:00
#include "vector.h"
2014-02-09 22:10:30 -03:00
#include "core/reference.h"
2015-07-24 01:18:46 +01:00
#include "nrex.hpp"
2014-02-09 22:10:30 -03:00
class RegEx : public Reference {
OBJ_TYPE(RegEx, Reference);
mutable String text;
2015-07-24 01:18:46 +01:00
mutable Vector<nrex_result> captures;
nrex exp;
2014-02-09 22:10:30 -03:00
protected:
static void _bind_methods();
2015-07-24 14:09:39 +01:00
StringArray _bind_get_captures() const;
2014-02-09 22:10:30 -03:00
public:
void clear();
bool is_valid() const;
int get_capture_count() const;
2015-07-24 01:18:46 +01:00
String get_capture(int capture) const;
Error compile(const String& p_pattern, int capture = 9);
2015-07-24 14:09:39 +01:00
int find(const String& p_text, int p_start = 0, int p_end = -1) const;
2014-02-09 22:10:30 -03:00
RegEx();
RegEx(const String& p_pattern);
~RegEx();
};
#endif // REGEX_H