// SPDX-License-Identifier: MIT #pragma once #include #include #include #include namespace FEXCore::StrConv { [[maybe_unused]] static bool Conv(std::string_view Value, bool *Result) { *Result = std::strtoull(Value.data(), nullptr, 0); return true; } [[maybe_unused]] static bool Conv(std::string_view Value, uint8_t *Result) { *Result = std::strtoul(Value.data(), nullptr, 0); return true; } [[maybe_unused]] static bool Conv(std::string_view Value, uint16_t *Result) { *Result = std::strtoul(Value.data(), nullptr, 0); return true; } [[maybe_unused]] static bool Conv(std::string_view Value, uint32_t *Result) { *Result = std::strtoul(Value.data(), nullptr, 0); return true; } [[maybe_unused]] static bool Conv(std::string_view Value, int32_t *Result) { *Result = std::strtol(Value.data(), nullptr, 0); return true; } [[maybe_unused]] static bool Conv(std::string_view Value, uint64_t *Result) { *Result = std::strtoull(Value.data(), nullptr, 0); return true; } template ::value, T>> [[maybe_unused]] static bool Conv(std::string_view Value, T *Result) { *Result = static_cast(std::stoull(Value.data(), nullptr, 0)); return true; } [[maybe_unused]] static bool Conv(std::string_view Value, fextl::string *Result) { *Result = Value; return true; } }