HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_StringMMPattern.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_StringMMPattern.h
7  *
8  * COMMENTS:
9  * Class holding a compiled pattern for UT_String::multiMatch().
10  */
11 
12 #ifndef __UT_StringMMPattern_h__
13 #define __UT_StringMMPattern_h__
14 
15 #include "UT_API.h"
16 #include "UT_NonCopyable.h"
17 #include "UT_UniquePtr.h"
18 #include <SYS/SYS_Types.h>
19 
20 class ut_CompiledMMPatternImpl;
21 
23 {
24 public:
26 
27  explicit UT_StringMMPattern(
28  const char *pattern_buffer,
29  bool case_sensitive = true,
30  const char *separators = ", ");
31 
33 
35 
36  bool isEmpty() const { return myImpl == nullptr; }
37  void clear();
38  void compileInPlace(char *pattern_buffer, bool case_sensitive = true,
39  const char *separators = ", ");
40  void compileInPlace(char *pattern_buffer, bool case_sensitive,
41  char separator)
42  {
43  char separators[2];
44  separators[0] = separator;
45  separators[1] = 0;
46  compileInPlace(pattern_buffer, case_sensitive, separators);
47  }
48  void compile(const char *pattern_buffer, bool case_sensitive = true,
49  const char *separators = ", ");
50  void compile(const char *pattern_buffer, bool case_sensitive,
51  char separator)
52  {
53  char separators[2];
54  separators[0] = separator;
55  separators[1] = 0;
56  compile(pattern_buffer, case_sensitive, separators);
57  }
58 
59  int64 getMemoryUsage(bool inclusive) const;
60 
61 private:
63 
64  friend class UT_String;
65 };
66 
67 #endif
void compileInPlace(char *pattern_buffer, bool case_sensitive, char separator)
#define UT_API
Definition: UT_API.h:14
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
long long int64
Definition: SYS_Types.h:116
void compile(const char *pattern_buffer, bool case_sensitive, char separator)