4 * Created on: Jan 20, 2011
15 Store::Store(string device_id_param,
17 device_id = device_id_param;
18 if (date_param != NULL) {
19 date = date_param->clone();
29 if (store_data != NULL) {
38 bool Store::load(string fname_param) {
45 if (store_data != NULL) {
49 if (access(fname_param.c_str(), R_OK) == 0) {
50 //log_debug("opening file: %s\n", fname_param.c_str());
51 in.open(fname_param.c_str());
52 if (in.is_open() == true) {
53 while (in.eof() == false) {
54 getline(in, data_str);
55 if (data_str.empty() == false) {
56 data = Data::parse_string(data_str);
58 if (store_data == NULL) {
59 store_data = new DataRange(data);
62 store_data->add(data);
71 log_error("Could not open data file: %s\n", fname_param.c_str());
75 log_error("Could not find file: %s\n", fname_param.c_str());