mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-06-01 01:54:00 +00:00
Style audit: update code to strictly follow Google Style Guide
This commit is contained in:
@@ -13,8 +13,8 @@
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
|
||||
static auto ReadRequiredString(const boost::json::object& object,
|
||||
const char* key) -> std::string {
|
||||
static std::string ReadRequiredString(const boost::json::object& object,
|
||||
const char* key) {
|
||||
const boost::json::value* value = object.if_contains(key);
|
||||
if (value == nullptr || !value->is_string()) {
|
||||
throw std::runtime_error(
|
||||
@@ -23,8 +23,8 @@ static auto ReadRequiredString(const boost::json::object& object,
|
||||
return std::string(value->as_string().c_str());
|
||||
}
|
||||
|
||||
static auto ReadRequiredNumber(const boost::json::object& object,
|
||||
const char* key) -> double {
|
||||
static double ReadRequiredNumber(const boost::json::object& object,
|
||||
const char* key) {
|
||||
const boost::json::value* value = object.if_contains(key);
|
||||
if (value == nullptr || !value->is_number()) {
|
||||
throw std::runtime_error(
|
||||
@@ -33,8 +33,7 @@ static auto ReadRequiredNumber(const boost::json::object& object,
|
||||
return value->to_number<double>();
|
||||
}
|
||||
|
||||
auto JsonLoader::LoadLocations(const std::string& filepath)
|
||||
-> std::vector<Location> {
|
||||
std::vector<Location> JsonLoader::LoadLocations(const std::string& filepath) {
|
||||
std::ifstream input(filepath);
|
||||
if (!input.is_open()) {
|
||||
throw std::runtime_error("Failed to open locations file: " + filepath);
|
||||
@@ -44,7 +43,7 @@ auto JsonLoader::LoadLocations(const std::string& filepath)
|
||||
buffer << input.rdbuf();
|
||||
const std::string content = buffer.str();
|
||||
|
||||
boost::json::error_code error;
|
||||
boost::system::error_code error;
|
||||
boost::json::value root = boost::json::parse(content, error);
|
||||
if (error) {
|
||||
throw std::runtime_error("Failed to parse locations JSON: " +
|
||||
|
||||
Reference in New Issue
Block a user