HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_ExpandArray.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_ExpandArray.h ( UT Library, C++)
7  *
8  * COMMENTS:
9  * This class is used to encapsulate the methods
10  * involved with expanding a string pattern.
11  */
12 
13 #ifndef __UT_ExpandArray__
14 #define __UT_ExpandArray__
15 
16 #include "UT_API.h"
17 #include "UT_Assert.h"
18 #include "UT_String.h"
19 
21 {
22 
23 public:
24 
25  explicit UT_ExpandArray(int start_size = 10);
26  ~UT_ExpandArray();
27 
28  int entries() const
29  { return myCurSize; }
30 
31  const char *operator()(unsigned int i) const
32  {
33  UT_ASSERT_P(i < myCurSize);
34  return myToken[i];
35  }
36 
37  int setPattern(const char *pattern, int *dirty_flag=0);
38  int appendPattern(const char *pattern);
39 
40  const UT_String &getPattern() const
41  { return myPattern; }
42 
43  int64 getMemoryUsage(bool inclusive) const;
44 
45 private:
46  void setPattern(const char *pattern, int append);
47  void clear();
48 
49  UT_String myPattern;
50  int myMaxSize;
51  int myCurSize;
52  char **myToken;
53 
54 };
55 
56 #endif
57 
const char * operator()(unsigned int i) const
int entries() const
#define UT_API
Definition: UT_API.h:13
png_uint_32 i
Definition: png.h:2877
long long int64
Definition: SYS_Types.h:107
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:125
const UT_String & getPattern() const