[mareframe] Annotation of /trunk/gadget/strstack.h
Annotation of /trunk/gadget/strstack.h
Parent Directory
| Revision Log
Revision 1 -
(view)
(download)
1 : |
agomez |
1 |
#ifndef strstack_h
|
2 : |
|
|
#define strstack_h
|
3 : |
|
|
|
4 : |
|
|
#include "charptrvector.h" |
5 : |
|
|
|
6 : |
|
|
/**
|
7 : |
|
|
* \class StrStack
|
8 : |
|
|
* \brief This class implements a simple stack of string objects
|
9 : |
|
|
*/
|
10 : |
|
|
class StrStack {
|
11 : |
|
|
public:
|
12 : |
|
|
/**
|
13 : |
|
|
* \brief This is the default StrStack constructor
|
14 : |
|
|
*/
|
15 : |
|
|
StrStack() { size = 0; };
|
16 : |
|
|
/**
|
17 : |
|
|
* \brief This is the default StrStack destructor
|
18 : |
|
|
*/
|
19 : |
|
|
~StrStack();
|
20 : |
|
|
/**
|
21 : |
|
|
* \brief This function will remove the top string from the stack
|
22 : |
|
|
*/
|
23 : |
|
|
void clearString();
|
24 : |
|
|
/**
|
25 : |
|
|
* \brief This function will put a new string on to the top of the stack
|
26 : |
|
|
* \param str is the name of the string
|
27 : |
|
|
*/
|
28 : |
|
|
void storeString(const char* str);
|
29 : |
|
|
/**
|
30 : |
|
|
* \brief This function will clear all the strings from the stack
|
31 : |
|
|
*/
|
32 : |
|
|
void clearStack() { size = 0; };
|
33 : |
|
|
/**
|
34 : |
|
|
* \brief This function will send all the strings on the stack as one long new string
|
35 : |
|
|
* \return stack
|
36 : |
|
|
*/
|
37 : |
|
|
char* sendAll() const;
|
38 : |
|
|
/**
|
39 : |
|
|
* \brief This function will send the top string from the stack as a new string
|
40 : |
|
|
* \return string
|
41 : |
|
|
*/
|
42 : |
|
|
char* sendTop() const;
|
43 : |
|
|
/**
|
44 : |
|
|
* \brief This will return the number of strings currently stored on the stack
|
45 : |
|
|
* \return the number of strings on the stack
|
46 : |
|
|
*/
|
47 : |
|
|
int getSize() { return size; };
|
48 : |
|
|
private:
|
49 : |
|
|
/**
|
50 : |
|
|
* \brief This is size of the string stack
|
51 : |
|
|
*/
|
52 : |
|
|
int size;
|
53 : |
|
|
/**
|
54 : |
|
|
* \brief This is the CharPtrVector containing the strings in the stack
|
55 : |
|
|
*/
|
56 : |
|
|
CharPtrVector v;
|
57 : |
|
|
};
|
58 : |
|
|
|
59 : |
|
|
#endif
|
|