lyx_mirror/src/support/LRegex.h
Lars Gullik Bjønnes 797d87b451 make doc++ able to generate the source documentation for lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@956 a592a061-630c-0410-9148-cb99ea01b6c8
2000-08-07 20:58:24 +00:00

60 lines
872 B
C++

// -*- C++ -*-
/* C++ wrapper around the POSIX regex functions:
regcomp, regexec, regerror, regfree.
*/
#ifndef LREGEX_H
#define LREGEX_H
#ifdef __GNUG__
#pragma interface
#endif
#include "LString.h"
#include <vector>
///
class LRegex {
public:
///
explicit
LRegex(string const & regex);
///
~LRegex();
///
typedef std::pair<string::size_type, string::size_type> MatchPair;
///
typedef std::vector<MatchPair> SubMatches;
/// Returns all the matches in a vector
SubMatches const & exec(string const & str) const;
/// The whole of str matches regex.
bool exact_match(string const & str) const;
///
MatchPair const first_match(string const & str) const;
///
string const getError() const;
///
int getErrorCode() const;
/// Will the next operation fail of not.
bool ok() const;
private:
///
struct Impl;
///
Impl * impl;
};
#endif