redo it with mongoose

add all previous POC api endpoints
This commit is contained in:
Aaron Kimbre
2025-01-02 16:11:45 -06:00
parent 070bec697c
commit e86f4e011b
18 changed files with 23916 additions and 935 deletions

View File

@@ -18,6 +18,9 @@
#include "dPlatforms.h"
#include "Game.h"
#include "Logger.h"
#include "json.hpp"
using json = nlohmann::json;
enum eInventoryType : uint32_t;
enum class eObjectBits : size_t;
@@ -260,6 +263,20 @@ namespace GeneralUtils {
return (str.size() == 3) ? TryParse<NiPoint3>(str[0], str[1], str[2]) : std::nullopt;
}
// /**
// * The TryParse overload for handling json parsing
// * @param str The string that is the json to parse
// * @returns An std::optional containing the desired json if it can be parsed from the string
// */
// template <typename T>
// [[nodiscard]] std::optional<json> TryParse(const std::span<char*> str) {
// try {
// return std::make_optional<json>(json::parse(str));
// } catch (const std::exception& e) {
// return std::nullopt;
// }
// }
template <typename T>
std::u16string to_u16string(const T value) {
return GeneralUtils::ASCIIToUTF16(std::to_string(value));

View File

@@ -80,6 +80,7 @@ public:
void SetLogToConsole(bool logToConsole);
void SetLogDebugStatements(bool logDebugStatements) { m_logDebugStatements = logDebugStatements; }
bool GetLogDebugStatements() const { return m_logDebugStatements; }
private:
void vLog(const char* format, va_list args);