gxXmlTable Class Reference

Utility class for sending and receiving XML content that has elements similar to an HTML table. More...

#include <gxXmlTable.h>

List of all members.

Public Types

typedef std::vector< std::string > strings_t
enum  error_codes_t {
  TABLE_OK = 0, TABLE_NOHEADERS = 1, TABLE_MULTIHEADERS = 2, TABLE_TOOFEW = 3,
  TABLE_TOOMANY = 4
}

Public Member Functions

 gxXmlTable ()
virtual ~gxXmlTable ()
int addHeaders (std::list< std::string > &items)
int addHeaders (const char *item1, const char *item2=NULL, const char *item3=NULL, const char *item4=NULL)
 Convenience method for adding headers with up to 4 columns.
int addRow (std::list< std::string > &items)
int addRow (const char *item1, const char *item2=NULL, const char *item3=NULL, const char *item4=NULL)
 Convenience method for adding a row with up to 4 columns.
int getColumnCount ()
 Return the number of columns in the table.
std::string getColumnText (int index)
 Return the column header text for the specified, zero-based index.
int getColumnIndex (const char *text)
 Return the column header index with the given label.
std::string getId ()
 Returns the table id.
int getRowCount ()
 Returns the number of rows in the table.
std::string getItem (int rowIndex, int columnIndex)
 Gets the text items at the specified row/column index.
void setId (const char *id)
void write (std::ostream &out)
 When sending table messages, create the table using addHeaders and add row, then invoke this method to write the XML to a stream.


Detailed Description

Utility class for sending and receiving XML content that has elements similar to an HTML table.

The document is enclosed by a "table" tag. It has a sequence of "tr" rows. The first row contains a series of "th" elements. All subsequent rows contain a series of "td" elements.

This class is not intended to be used with HTML however. Its just a convenient way to pass around two-dimensional lists, such as the name and clsid of all soft synths in the system.


Member Typedef Documentation

typedef std::vector<std::string> gxXmlTable::strings_t
 


Member Enumeration Documentation

enum gxXmlTable::error_codes_t
 

Enumerator:
TABLE_OK 
TABLE_NOHEADERS 
TABLE_MULTIHEADERS 
TABLE_TOOFEW 
TABLE_TOOMANY 


Constructor & Destructor Documentation

gxXmlTable::gxXmlTable  ) 
 

virtual gxXmlTable::~gxXmlTable  )  [virtual]
 


Member Function Documentation

int gxXmlTable::addHeaders const char *  item1,
const char *  item2 = NULL,
const char *  item3 = NULL,
const char *  item4 = NULL
 

Convenience method for adding headers with up to 4 columns.

int gxXmlTable::addHeaders std::list< std::string > &  items  ) 
 

int gxXmlTable::addRow const char *  item1,
const char *  item2 = NULL,
const char *  item3 = NULL,
const char *  item4 = NULL
 

Convenience method for adding a row with up to 4 columns.

int gxXmlTable::addRow std::list< std::string > &  items  ) 
 

int gxXmlTable::getColumnCount  ) 
 

Return the number of columns in the table.

If no headers have been added, return 0;

int gxXmlTable::getColumnIndex const char *  text  ) 
 

Return the column header index with the given label.

If no such column exists, return -1;

std::string gxXmlTable::getColumnText int  index  ) 
 

Return the column header text for the specified, zero-based index.

std::string gxXmlTable::getId  )  [inline]
 

Returns the table id.

std::string gxXmlTable::getItem int  rowIndex,
int  columnIndex
 

Gets the text items at the specified row/column index.

int gxXmlTable::getRowCount  ) 
 

Returns the number of rows in the table.

void gxXmlTable::setId const char *  id  )  [inline]
 

void gxXmlTable::write std::ostream &  out  ) 
 

When sending table messages, create the table using addHeaders and add row, then invoke this method to write the XML to a stream.


The documentation for this class was generated from the following file:
Generated on Mon Nov 21 01:01:37 2005 for gxLib by  doxygen 1.4.5