Jamoma API  0.6.0.a19
TTRegex.h
1 /*
2  * TTRegex
3  * Copyright © 2008, Théo de la Hogue & Tim Place
4  *
5  * License: This code is licensed under the terms of the "New BSD License"
6  * http://creativecommons.org/licenses/BSD/
7  */
8 
9 #ifndef __TT_REGEX_H__
10 #define __TT_REGEX_H__
11 
12 #ifdef WIN_VERSION
13  #pragma warning(disable:4083) //warning C4083: expected 'newline'; found identifier 's'
14 #endif // WIN_VERSION
15 
16 #include "TTFoundationAPI.h"
17 
18 /****************************************************************************************************/
19 // Class Specifications
20 
21 /**
22 
23  */
24 
25 class TTFOUNDATION_EXPORT TTRegex {
26 
27 private:
28 
29  TTPtr mExpression; ///< the pointer to the boost::regex expression
30  TTPtr mResult; ///< the pointer to the boost::match_results <std::string::const_iterator>
31  int mExpectedMatch; ///< the expected position for the match in match_results (generally 0 or 1)
32 public:
33 
34  /** Constructor */
35  TTRegex(const char* anExpression, int expectedMatch = 1);
36 
37  /** Destructor */
38  virtual ~TTRegex();
39 
40  /** Parse a string using the expression
41  @param begin the beginning of the string to parse
42  @param end the end of the string to parse
43  @return a error code */
44  TTErr parse(TTStringIter begin, TTStringIter end);
45 
46  /** Get where start the result */
47  TTStringIter begin();
48 
49  /** Get where end the result */
50  TTStringIter end();
51 };
52 
53 
54 #endif // __TT_REGEX_H__
void * TTPtr
A generic pointer.
Definition: TTBase.h:248
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342