You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
719 B
32 lines
719 B
/* |
|
* @Author: IoTcat (https://iotcat.me) |
|
* @Date: 2019-05-24 17:01:37 |
|
* @Last Modified by: IoTcat |
|
* @Last Modified time: 2019-05-24 17:01:37 |
|
*/ |
|
|
|
|
|
#include "car.h" |
|
|
|
Car::Car(const string& licenseNum, const string& type, const string& plot) { |
|
this->_d["id"] = licenseNum; |
|
this->_d["type"] = type; |
|
this->_d["plot"] = plot; |
|
this->_d["LastInTime"] = to_string(time(NULL)); |
|
this->_d["LastOutTime"] = "null"; |
|
this->_isExist = true; |
|
} |
|
|
|
Car::Car(const string& s) { |
|
this->_isExist = false; |
|
|
|
if (s == "undefined") { |
|
return; |
|
} |
|
|
|
this->_d = this->_d.strToData(s); |
|
|
|
if (this->_d["id"] == "undefined") return; |
|
|
|
this->_isExist = true; |
|
}
|
|
|