StringList

Overview

A StringList is for communicating a list of strings between Emdros and the program using Emdros.

The list is ordered, and can be iterated with the normal Emdros-iterators.

SPECIAL SWIG JAVA NOTE: Use of the StringListConstIterator is discouraged under Java. Instead, please use the getAsVector() method, which will return a Java Vector of Java String objects.


#include <string_list.h>

class StringListConstIterator {
public:
  StringListConstIterator();
  StringListConstIterator(const StringList *pMotherStringList); // Not SWIG-wrapped.
  StringListConstIterator(const StringListConstIterator& other);
  ~StringListConstIterator();
  bool hasNext() const; // Is the iterator == end iterator?  Doesn't alter iterator
  std::string next(); // Gets current and advances iterator afterwards
  std::string previous();  // Regresses iterator and then gets current
  std::string current(); // Gets current without altering iterator
};

class StringList {
public:
  // Create empty string list, to be populated later
  // with addStringListNodes.
  StringList();

  // Copy constructor
  StringList(const StringList& other);

  // Assignment operator
  const StringList& operator=(const StringList& other); // Not SWIG-wrapped!

  ~StringList();

  StringListConstIterator const_iterator() const;

  // Add at beginning of list, pushing everything down one member
  void addStringFront(const std::string& str);

  // Add at end of list
  void addStringBack(const std::string& str);

  std::vector<std::string> getAsVector(void) const;

  // Return the length
  int getLength() const;

  bool isEmpty(void) const;
};


Previous:MQLResult
Up:Part II: APIs
Next:IntegerList