4 * Created on: Jan 20, 2011
16 Store::Store(string device_id_param,
18 device_id = device_id_param;
19 if (date_param != NULL) {
20 date = date_param->clone();
30 if (store_data != NULL) {
39 bool Store::load(string fname_param) {
46 if (store_data != NULL) {
50 if (access(fname_param.c_str(), R_OK) == 0) {
51 //log_debug("opening file: %s\n", fname_param.c_str());
52 in.open(fname_param.c_str());
53 if (in.is_open() == true) {
54 while (in.eof() == false) {
55 getline(in, data_str);
56 if (data_str.empty() == false) {
57 data = Data::parse_string(data_str);
59 if (store_data == NULL) {
60 store_data = new DataRange(data);
63 store_data->add(data);
72 log_error("Could not open data file: %s\n", fname_param.c_str());
76 log_warning("Could not open data file, file does not exist or user does not have read access for it: %s\n", fname_param.c_str());