#include <FARdb.h>
Public Member Functions | |
FARData (int n=0) | |
~FARData (void) | |
void | update_nfieldsmax (int n_f) |
int | n_fields_max (void) const |
int | n_records (void) const |
int | add_record (const Record &rec) |
void | xfer_record (int r, FARData &db) |
void | delete_record (int r) |
void | delete_all_records (void) |
void | delete_field (int f) |
Record & | operator[] (int i) |
const Record & | operator[] (int i) const |
void | append_from_file (string file_name, string separator=",") |
void | read_from_file (string file_name, FARReadFileMode read_mode=FARREADFILE_REPLACE, string separator=",") |
void | write_to_file (string file_name="FARdata.csv", FARWriteFileMode write_mode=FARWRITEFILE_NEW, string separator=",") |
void | sort_records_by_field (const FARcompare_records_by_field &cmp) |
int | match_record_by_field (int field, string s, int r_start=0, int r_end=-1) const |
int | match_record_by_field (int field, double x, int r_start=0, int r_end=-1) const |
void | set_field_name (int f, string field_name) |
int | get_field_number (string field_name) |
void | diag_print (void) const |
Static Public Member Functions | |
static int | xtokenize_string (const char *s, const char *delimiters, vector< string > &tokens) |
static int | tokenize_string (const char *s, const char *delimiters, vector< string > &token_list) |
Static Private Member Functions | |
static void | trim_whitespace (string &s) |
static bool | is_comment_line (const char *s) |
Private Attributes | |
vector< Record > | records |
int | nfieldsmax |
map< string, int > | field_by_name |
FAR::FARData::FARData | ( | int | n = 0 |
) | [inline] |
FAR::FARData::~FARData | ( | void | ) | [inline] |
int FAR::FARData::add_record | ( | const Record & | rec | ) | [inline] |
void FAR::FARData::append_from_file | ( | string | file_name, | |
string | separator = "," | |||
) | [inline] |
void FAR::FARData::delete_all_records | ( | void | ) | [inline] |
void FAR::FARData::delete_field | ( | int | f | ) |
void FAR::FARData::delete_record | ( | int | r | ) | [inline] |
void FAR::FARData::diag_print | ( | void | ) | const |
int FAR::FARData::get_field_number | ( | string | field_name | ) | [inline] |
bool FAR::FARData::is_comment_line | ( | const char * | s | ) | [static, private] |
int FAR::FARData::match_record_by_field | ( | int | field, | |
double | x, | |||
int | r_start = 0 , |
|||
int | r_end = -1 | |||
) | const |
int FAR::FARData::match_record_by_field | ( | int | field, | |
string | s, | |||
int | r_start = 0 , |
|||
int | r_end = -1 | |||
) | const [inline] |
int FAR::FARData::n_fields_max | ( | void | ) | const [inline] |
int FAR::FARData::n_records | ( | void | ) | const [inline] |
const Record& FAR::FARData::operator[] | ( | int | i | ) | const [inline] |
Record& FAR::FARData::operator[] | ( | int | i | ) | [inline] |
void FAR::FARData::read_from_file | ( | string | file_name, | |
FARReadFileMode | read_mode = FARREADFILE_REPLACE , |
|||
string | separator = "," | |||
) | [inline] |
void FAR::FARData::set_field_name | ( | int | f, | |
string | field_name | |||
) | [inline] |
void FAR::FARData::sort_records_by_field | ( | const FARcompare_records_by_field & | cmp | ) | [inline] |
static int FAR::FARData::tokenize_string | ( | const char * | s, | |
const char * | delimiters, | |||
vector< string > & | token_list | |||
) | [inline, static] |
static void FAR::FARData::trim_whitespace | ( | string & | s | ) | [inline, static, private] |
void FAR::FARData::update_nfieldsmax | ( | int | n_f | ) | [inline] |
void FAR::FARData::write_to_file | ( | string | file_name = "FARdata.csv" , |
|
FARWriteFileMode | write_mode = FARWRITEFILE_NEW , |
|||
string | separator = "," | |||
) | [inline] |
void FAR::FARData::xfer_record | ( | int | r, | |
FARData & | db | |||
) | [inline] |
int FAR::FARData::xtokenize_string | ( | const char * | s, | |
const char * | delimiters, | |||
vector< string > & | tokens | |||
) | [static] |
map<string,int> FAR::FARData::field_by_name [private] |
int FAR::FARData::nfieldsmax [private] |
vector<Record> FAR::FARData::records [private] |