Mobile API Reference  MicroStrategy 2019
StringCollectionImpl.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : StringCollectionImpl.h
3 // AUTHOR : Yi Luo
4 // CREATION : 12/19/02
5 // Copyright (C) MicroStrategy, Inc. 2002
6 //==============================================================================================
7 #ifndef MDataType_StringCollectionImpl_h
8 #define MDataType_StringCollectionImpl_h
9 
10 #include "PDCvector"
11 #include <string>
12 
13 #include "../StringCollection.h"
14 
15 namespace MDataType
16 {
21  public StringCollection
22  {
23  public:
24 
26  virtual ~StringCollectionImpl() throw()
27  {
28  }
29 
30  protected:
31 
33  virtual void Insert(const char* ipString);
34 
36  virtual void Insert(const StringCollection& irStringCollection);
37 
39  virtual size_t GetCount() const throw();
40 
42  virtual const char* GetString(size_t iStringIndex) const;
43 
45  virtual void Clear();
46 
47  public:
48 
49  // The elements (pointers) of mvStrings are allocated on heap.
50  typedef std::vector<std::string*> StringVector;
51 
52  private:
53 
54  StringVector mvStrings;
55 
59  class StringVectorGuard
60  {
61  public:
62 
63  StringVectorGuard(StringVector& irStringVector);
64  ~StringVectorGuard() throw();
65  void Dismiss() throw();
66 
67  private:
68 
69  StringVector& mrStringVector;
70  bool mDismissed;
71  };
72 
73  const StringVectorGuard mCleanupGuard;
74  };
75 }
76 
77 #endif // MDataType_StringCollectionImpl_h
virtual const char * GetString(size_t iStringIndex) const
Definition: LessThanGUID.h:49
Definition: BigDecimal.h:18
virtual size_t GetCount() const
virtual void Insert(const char *ipString)
Definition: StringCollection.h:19
Definition: StringCollectionImpl.h:20
virtual ~StringCollectionImpl()
Definition: StringCollectionImpl.h:26
std::vector< std::string * > StringVector
Definition: StringCollectionImpl.h:50