Gadget
strstack.h
Go to the documentation of this file.
1 #ifndef strstack_h
2 #define strstack_h
3 
4 #include "charptrvector.h"
5 
10 class StrStack {
11 public:
15  StrStack() { size = 0; };
19  ~StrStack();
23  void clearString();
28  void storeString(const char* str);
32  void clearStack() { size = 0; };
37  char* sendAll() const;
42  char* sendTop() const;
47  int getSize() { return size; };
48 private:
52  int size;
56  CharPtrVector v;
57 };
58 
59 #endif
This class implements a dynamic vector of char values.
Definition: charptrvector.h:8
This class implements a simple stack of string objects.
Definition: strstack.h:10
int getSize()
This will return the number of strings currently stored on the stack.
Definition: strstack.h:47
StrStack()
This is the default StrStack constructor.
Definition: strstack.h:15
void clearStack()
This function will clear all the strings from the stack.
Definition: strstack.h:32
void clearString()
This function will remove the top string from the stack.
Definition: strstack.cc:10
~StrStack()
This is the default StrStack destructor.
Definition: strstack.cc:4
char * sendTop() const
This function will send the top string from the stack as a new string.
Definition: strstack.cc:35
char * sendAll() const
This function will send all the strings on the stack as one long new string.
Definition: strstack.cc:24
void storeString(const char *str)
This function will put a new string on to the top of the stack.
Definition: strstack.cc:15