source: trunk/gsinstaller/stringArrayMap.cpp@ 1397

Last change on this file since 1397 was 1397, checked in by cs025, 24 years ago

Initial revision

  • Property svn:keywords set to Author Date Id Revision
File size: 1002 bytes
Line 
1#include "stringArrayMap.h"
2
3stringArrayMap::stringArrayMap()
4{
5}
6
7void stringArrayMap::add(string key, stringArray array)
8{ this->_map[key].add(array);
9}
10
11void stringArrayMap::addToArray(string key, string item)
12{ this->_map[key].add(item);
13}
14
15void stringArrayMap::readArray(string key, stringArray &toArray)
16{ toArray = this->_map[key];
17}
18
19stringArray &stringArrayMap::operator[] (const string &name)
20{ return this->_map[name];
21}
22
23string &stringArrayMap::key(unsigned int pos)
24{ map<string, stringArray, less<string> >::iterator here = this->_map.begin();
25 while (pos > 0)
26 { here ++;
27 pos --;
28 }
29 return (*here).first;
30}
31
32stringArray &stringArrayMap::array(unsigned int pos)
33{ map<string, stringArray, less<string> >::iterator here = this->_map.begin();
34 while (pos > 0)
35 { here ++;
36 pos --;
37 }
38 return (*here).second;
39}
40
41void stringArrayMap::clear()
42{ this->_map.empty();
43}
44
45unsigned int stringArrayMap::size()
46{ return this->_map.size();
47}
Note: See TracBrowser for help on using the repository browser.