]> git.lyx.org Git - lyx.git/blobdiff - src/support/LRegex.h
make doc++ able to generate the source documentation for lyx
[lyx.git] / src / support / LRegex.h
index de0ce61f685788e11754972db710e63c8ea28a8f..6db4f410597d8d8c17c921ba80d8e0aa1f55e3cd 100644 (file)
 
 #include <vector>
 
-using std::vector;
-using std::pair;
-
 ///
 class LRegex {
 public:
        ///
+       explicit
        LRegex(string const & regex);
 
        ///
        ~LRegex();
 
        ///
-       typedef pair<string::size_type, string::size_type> MatchPair;
+       typedef std::pair<string::size_type, string::size_type> MatchPair;
 
        ///
-       typedef vector<MatchPair> SubMatches;
+       typedef std::vector<MatchPair> SubMatches;
 
        /// Returns all the matches in a vector
        SubMatches const & exec(string const & str) const;
@@ -40,10 +38,10 @@ public:
        bool exact_match(string const & str) const;
 
        ///
-       MatchPair first_match(string const & str) const;
+       MatchPair const first_match(string const & str) const;
 
        ///
-       string getError() const;
+       string const getError() const;
 
        ///
        int getErrorCode() const;
@@ -58,20 +56,4 @@ private:
        Impl * impl;
 };
 
-
-// We comment out these, we can comment them in when we need them.
-#if 0
-// some built in regular expressions
-
-extern const LRegex LRXwhite;          // = "[ \n\t\r\v\f]+"
-extern const LRegex LRXint;            // = "-?[0-9]+"
-extern const LRegex LRXdouble;         // = "-?\\(\\([0-9]+\\.[0-9]*\\)\\|
-                                       //    \\([0-9]+\\)\\|\\(\\.[0-9]+\\)\\)
-                                       //    \\([eE][---+]?[0-9]+\\)?"
-//extern const LRegex LRXalpha;          // = "[A-Za-z]+"
-//extern const LRegex LRXlowercase;      // = "[a-z]+"
-//extern const LRegex LRXuppercase;      // = "[A-Z]+"
-//extern const LRegex LRXalphanum;       // = "[0-9A-Za-z]+"
-extern const LRegex LRXidentifier;     // = "[A-Za-z_][A-Za-z0-9_]*"
-#endif
 #endif