source: other-projects/gs2-export-cdrom-installer/trunk/stringArray.h@ 21709

Last change on this file since 21709 was 11664, checked in by mdewsnip, 18 years ago

Fixed the line endings... for real this time, I hope.

  • Property svn:keywords set to Author Date Id Revision
File size: 1.1 KB
Line 
1#ifndef _STRINGARRAY_H_
2#define _STRINGARRAY_H_
3#include <string>
4#include <vector>
5#include <map>
6
7// use the standard namespace
8#if !defined (GSDL_NAMESPACE_BROKEN)
9#if defined(GSDL_USE_OBJECTSPACE)
10using namespace ospace::std;
11#else
12using namespace std;
13#endif
14#endif
15
16#include <string.h>
17
18class stringArray
19{
20private:
21 vector<string> array;
22 bool permitDups;
23protected:
24public:
25 stringArray();
26 stringArray(char *list, char *divider);
27 void permitDuplication(bool permit);
28 void add(char *member);
29 void add(string member);
30 void add(stringArray &array);
31 void insertAt(string member, unsigned int at);
32 void remove(char *member);
33 void remove(string member);
34 void clear();
35 bool includes(char *member);
36 bool includes(string member);
37 static stringArray words(char *line);
38 unsigned int size(){ return this->array.size(); };
39 int indexOf(char *member);
40 int indexOf(string member);
41 int writeToCString(char *buffer, char *divider, int bufflen);
42 string toString(string separator);
43 string &operator[](const unsigned int);
44};
45
46typedef map<string, stringArray, less<string> > strArrayMap;
47#endif
Note: See TracBrowser for help on using the repository browser.