4 * Created on: Jan 20, 2011
17 Store::Store(string device_id_param,
19 device_id = device_id_param;
20 if (date_param != NULL) {
21 date = date_param->clone();
31 if (store_data != NULL) {
40 bool Store::load(string fname_param) {
47 if (store_data != NULL) {
51 if (access(fname_param.c_str(), R_OK) == 0) {
52 //log_debug("opening file: %s\n", fname_param.c_str());
53 in.open(fname_param.c_str());
54 if (in.is_open() == true) {
55 while (in.eof() == false) {
56 getline(in, data_str);
57 if (data_str.empty() == false) {
58 data = Data::parse_string(data_str);
60 if (store_data == NULL) {
61 store_data = new DataRange(data);
64 store_data->add(data);
73 log_error("Could not open data file: %s\n", fname_param.c_str());
77 log_error("Could not find file: %s\n", fname_param.c_str());