63 GCsv(
const GFilename& filename,
const std::string& sep =
" ");
69 std::string&
operator()(
const int& row,
const int& col);
70 const std::string&
operator()(
const int& row,
const int& col)
const;
77 const int&
ncols(
void)
const;
78 const int&
nrows(
void)
const;
81 void append(
const std::vector<std::string>& list);
82 std::string
string(
const int& row,
const int& col)
const;
83 double real(
const int& row,
const int& col)
const;
84 int integer(
const int& row,
const int& col)
const;
85 void string(
const int& row,
const int& col,
const std::string& value);
86 void real(
const int& row,
const int& col,
const double& value);
87 void integer(
const int& row,
const int& col,
const int& value);
88 void load(
const GFilename& filename,
const std::string& sep =
" ");
89 void save(
const GFilename& filename,
const std::string& sep =
" ",
90 const bool& clobber =
false)
const;
102 std::vector<std::vector<std::string> >
m_data;
void append(const std::vector< std::string > &list)
Append list of strings.
void free_members(void)
Delete class members.
void save(const GFilename &filename, const std::string &sep=" ", const bool &clobber=false) const
Save CSV table.
int m_precision
Precision for floats.
GCsv(void)
Void constructor.
GCsv & operator=(const GCsv &csv)
Assignment operator.
void clear(void)
Clear CSV table.
Definition of interface for all GammaLib classes.
Comma-separated values table class.
virtual ~GCsv(void)
Destructor.
int m_cols
Number of columns.
std::string string(const int &row, const int &col) const
Get string value.
const int & ncols(void) const
Return number of columns.
void init_members(void)
Initialise class members.
const int & precision(void) const
Return fixed field floating point precision.
Interface class for all GammaLib classes.
std::string & operator()(const int &row, const int &col)
Table element access operator.
GCsv * clone(void) const
Clone CSV table.
std::string classname(void) const
Return class name.
int integer(const int &row, const int &col) const
Get integer value.
const int & nrows(void) const
Return number of rows.
int size(void) const
Return table size (columns times rows)
double real(const int &row, const int &col) const
Get double precision value.
int m_rows
Number of rows.
std::vector< std::vector< std::string > > m_data
CSV table data.
void load(const GFilename &filename, const std::string &sep=" ")
Load CSV table.
std::string print(const GChatter &chatter=NORMAL) const
Print column separated values information.
void copy_members(const GCsv &csv)
Copy class members.