Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CSVRow Class Reference

#include <csv.h>

Public Member Functions

std::string getRoot ()
 
size_t size ()
 
 CSVRow (CSVTable *parent, std::string key)
 
 CSVRow (CSVTable *parent, unsigned int which)
 
 CSVRow ()
 
const std::string & operator[] (const std::string &) const
 
const std::string & operator[] (unsigned int) const
 
const std::string & getKey (unsigned int which) const
 
std::vector< std::string >
::iterator 
begin ()
 
std::vector< std::string >
::iterator 
end ()
 
bool success () const
 
CSVTablegetParent ()
 

Detailed Description

Definition at line 45 of file csv.h.

Constructor & Destructor Documentation

CSVRow::CSVRow ( CSVTable parent,
std::string  key 
)
CSVRow::CSVRow ( CSVTable parent,
unsigned int  which 
)

Definition at line 159 of file csv.cpp.

References CSVTable::key.

160 {
161  this->parent = parent;
162  iter = i*parent->key.size();
163 }
CSVRow::CSVRow ( )
inline

Definition at line 57 of file csv.h.

58  {
59  parent = NULL;
60  iter = std::string::npos;
61  }

Member Function Documentation

std::vector< std::string >::iterator CSVRow::begin ( )
std::vector< std::string >::iterator CSVRow::end ( )
const string & CSVRow::getKey ( unsigned int  which) const

Definition at line 181 of file csv.cpp.

References CSVTable::key.

Referenced by Unit::WriteUnitString().

182 {
183  return parent->key[which];
184 }
CSVTable* CSVRow::getParent ( )
inline

Definition at line 71 of file csv.h.

Referenced by Unit::LoadRow().

72  {
73  return parent;
74  }
string CSVRow::getRoot ( )

Definition at line 206 of file csv.cpp.

References fprintf, and CSVTable::rootdir.

Referenced by GameUnit< UnitType >::Split().

207 {
208  if (parent)
209  return parent->rootdir;
210  fprintf( stderr, "Error getting root for unit\n" );
211  return "";
212 }
const std::string& CSVRow::operator[] ( const std::string &  ) const
const string & CSVRow::operator[] ( unsigned int  col) const

Definition at line 176 of file csv.cpp.

References CSVTable::table.

177 {
178  return parent->table[iter+col];
179 }
size_t CSVRow::size ( )
inline

Definition at line 51 of file csv.h.

References CSVTable::key.

Referenced by Unit::WriteUnitString().

52  {
53  return parent->key.size();
54  }
bool CSVRow::success ( ) const
inline

Definition at line 67 of file csv.h.

Referenced by UniverseUtil::LookupUnitStat(), and GameUnit< UnitType >::Split().

68  {
69  return parent != NULL;
70  }

The documentation for this class was generated from the following files: