Style audit: update code to strictly follow Google Style Guide

This commit is contained in:
Aaron Po
2026-04-11 11:56:45 -04:00
parent ae67fa8566
commit 5946356083
27 changed files with 129 additions and 127 deletions

View File

@@ -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: " +