Botball Game State
A game stared library for Botball, it helps model the table and different phases of the competition.
Loading...
Searching...
No Matches
Util.h
1#pragma once
2#include <json.hpp>
3#include <any>
4#include <iostream>
5#include <spdlog/sinks/basic_file_sink.h>
6#include <spdlog/sinks/stdout_color_sinks.h>
7#include <list>
8
9namespace Util {
10 using json = nlohmann::json;
11
18 std::list<std::string> split_string(const std::string &s, char delim);
19
25 std::shared_ptr<spdlog::logger> create_logger(const std::string &logger_name);
26
30 extern std::shared_ptr<spdlog::logger> LOG;
31
37 [[noreturn]] void fatal(const std::string &msg, const std::shared_ptr<spdlog::logger> &log = LOG);
38
44 std::unordered_map<std::string, std::any> get_key_value(const json &data);
45
51 uint32_t calculate_checksum(const std::string &s);
52
58 void validate_checksum(const json &data);
59}