예제 #1
0
파일: data_file.cpp 프로젝트: opncms/opncms
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
파일: data_file.cpp 프로젝트: opncms/opncms
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;
}