Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] View of /trunk/gadget/strstack.h
[mareframe] / trunk / gadget / strstack.h Repository:
ViewVC logotype

View of /trunk/gadget/strstack.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (download) (annotate)
Mon Feb 10 17:09:07 2014 UTC (10 years, 3 months ago) by agomez
File size: 1391 byte(s)
Initial version based on Gadget 2.2.00
#ifndef strstack_h
#define strstack_h

#include "charptrvector.h"

/**
 * \class StrStack
 * \brief This class implements a simple stack of string objects
 */
class StrStack {
public:
  /**
   * \brief This is the default StrStack constructor
   */
  StrStack() { size = 0; };
  /**
   * \brief This is the default StrStack destructor
   */
  ~StrStack();
  /**
   * \brief This function will remove the top string from the stack
   */
  void clearString();
  /**
   * \brief This function will put a new string on to the top of the stack
   * \param str is the name of the string
   */
  void storeString(const char* str);
  /**
   * \brief This function will clear all the strings from the stack
   */
  void clearStack() { size = 0; };
  /**
   * \brief This function will send all the strings on the stack as one long new string
   * \return stack
   */
  char* sendAll() const;
  /**
   * \brief This function will send the top string from the stack as a new string
   * \return string
   */
  char* sendTop() const;
  /**
   * \brief This will return the number of strings currently stored on the stack
   * \return the number of strings on the stack
   */
  int getSize() { return size; };
private:
  /**
   * \brief This is size of the string stack
   */
  int size;
  /**
   * \brief This is the CharPtrVector containing the strings in the stack
   */
  CharPtrVector v;
};

#endif

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge