+Data *Data::parse_data_string(const string& dataline) {
+ stringstream ss(dataline);
+ string item;
+ double val;
+ Data *ret_val;
+ int ii;
+ bool suc_flg;
+ vector<double> v;
+ Date date;
+
+ ii = 0;
+ while(getline(ss, item, '|')) {
+ if (ii == 0) {
+ // parse date
+ date = W1Util::parse_date_str(item);
+ }
+ // skip the device type and device id fields
+ // TODO: store device type and id to own file
+ else if (ii >= 3) {
+ suc_flg = string_to_number<double>(val, item, dec);
+ if (suc_flg) {
+ //log_debug("adding number: %f\n", val);
+ v.push_back(val);
+ }
+ }
+ ii++;
+ }
+ ret_val = new Data(v, &date);
+ return ret_val;
+}
+