source: trunk/gsinstaller/stringArray.h@ 2535

Last change on this file since 2535 was 1673, checked in by cs025, 23 years ago

Fixed problem in uninstalling which appeared when uninstalling the shortcut
icons.
Parameters to undo didn't permit two parameters to be the same, and if for
example a shortcut was in a group with the same name, a parameter
disappeared. Fixed by extending stringArray class to be configured to accept
duplicate entries.

  • 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.