示例#1
0
bool DataFile::get(cppcms::json::value& v, const std::string& storage)
{
	BOOSTER_LOG(debug,__FUNCTION__) << "storage(" << storage << ")";

	if (storage.empty()) {
		BOOSTER_LOG(error,__FUNCTION__) << "storage is empty";
		return false;
	}
	if (!tools::data::load(storage, v)) {
		BOOSTER_LOG(error,__FUNCTION__) << "Can`t load storage";
		return false;
	}
	if (v.is_undefined())
		return false;
	
	return true;
}
示例#2
0
bool DataFile::get(cppcms::json::value& v, const std::string& storage, const std::string& key)
{
	std::stringstream ss;
	
	BOOSTER_LOG(debug,__FUNCTION__) << "storage(" << storage << "), key(" << key << ")";

	if (storage.empty() || key.empty()) {
		BOOSTER_LOG(error,__FUNCTION__) << "storage/key are empty";
		return false;
	}

	if (!tools::data::load(storage, v)) {
		BOOSTER_LOG(error,__FUNCTION__) << "Can`t load storage";
		return false;
	}
	v = v.find(key);
	if (v.is_undefined())
		return false;
	return true;
}