00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __UT_ExpandArray__
00022 #define __UT_ExpandArray__
00023
00024 #include "UT_API.h"
00025 #include "UT_Assert.h"
00026 #include "UT_String.h"
00027
00028 class UT_API UT_ExpandArray
00029 {
00030
00031 public:
00032
00033 explicit UT_ExpandArray(int start_size = 10);
00034 ~UT_ExpandArray();
00035
00036 int entries() const
00037 { return myCurSize; }
00038
00039 const char *operator()(unsigned int i) const
00040 {
00041 UT_ASSERT_P(i < myCurSize);
00042 return myToken[i];
00043 }
00044
00045 int setPattern(const char *pattern, int *dirty_flag=0);
00046 int appendPattern(const char *pattern);
00047
00048 const UT_String &getPattern() const
00049 { return myPattern; }
00050
00051 private:
00052 void setPattern(const char *pattern, int append);
00053 void clear();
00054
00055 UT_String myPattern;
00056 int myMaxSize;
00057 int myCurSize;
00058 char **myToken;
00059
00060 };
00061
00062 #endif
00063