summaryrefslogtreecommitdiff
path: root/src/config/ConfigValue.cpp
blob: 1c658b05bb1b3dcf80088868d1cbfd6944cf84b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "ConfigValue.hpp"
#include "ConfigManager.hpp"

void local__configValuePopulate(void* const** p, void* const** hlangp, std::type_index* ti, const std::string& val) {
    const auto BIGP = Config::mgr()->getConfigValue(val);

    RASSERT(BIGP.dataptr, "Something went really fucking wrong with config values");

    *ti = std::type_index(*BIGP.type);

    if (std::type_index(*BIGP.type) == typeid(void*) || std::type_index(*BIGP.type) == typeid(const char*)) {
        // this is a special, cursed case. ew.
        *hlangp = BIGP.dataptr;
    } else
        *p = BIGP.dataptr;
}

std::type_index local__configValueTypeIdx(const std::string& val) {
    const auto BIGP = Config::mgr()->getConfigValue(val);
    return std::type_index(*BIGP.type);
}