HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_RegexResult.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_RegexResult.h (UT Library, C++)
7  *
8  * COMMENTS: Definition for UT_Regex::Result put in separate header to
9  * avoid including Boost until necessary.
10  *
11  */
12 
13 #ifndef __UT_REGEXRESULT_INCLUDED__
14 #define __UT_REGEXRESULT_INCLUDED__
15 
16 #include "UT_StringView.h"
17 #include <SYS/SYS_Types.h>
18 #include <hboost/xpressive/match_results.hpp>
19 
20 class UT_Regex;
21 
22 // fully inlined class
24 {
25 public:
26  bool empty() const { return myMatch.empty(); }
27 
28  exint size() const { return myMatch.size(); }
29 
31  {
32  const auto &match = myMatch[i];
33  return UT_StringView(match.first, match.second);
34  }
35  UT_StringView operator[](const char *name) const
36  {
37  const auto &match = myMatch[name];
38  return UT_StringView(match.first, match.second);
39  }
40 
41 private:
42  hboost::xpressive::cmatch myMatch;
43  friend class UT_Regex;
44 };
45 
46 #endif // __UT_REGEXRESULT_INCLUDED__
bool empty() const
int64 exint
Definition: SYS_Types.h:125
bool match(const char *string) const
A utility class to do read-only operations on a subset of an existing string.
Definition: UT_StringView.h:40
GLuint const GLchar * name
Definition: glcorearb.h:786
UT_StringView operator[](exint i) const
exint size() const
UT_StringView operator[](const char *name) const