2021-12-17 01:05:38 -05:00
|
|
|
#pragma once
|
|
|
|
|
2022-08-18 12:17:43 -04:00
|
|
|
#include <cstdint>
|
|
|
|
typedef float f32;
|
|
|
|
typedef double f64;
|
|
|
|
typedef int8_t i8;
|
|
|
|
typedef uint8_t u8;
|
|
|
|
typedef int16_t i16;
|
|
|
|
typedef uint16_t u16;
|
|
|
|
typedef int32_t i32;
|
|
|
|
typedef uint32_t u32;
|
|
|
|
typedef int64_t i64;
|
|
|
|
typedef uint64_t u64;
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2022-08-22 02:15:25 -04:00
|
|
|
#include <locale>
|
|
|
|
#include <codecvt>
|
|
|
|
|
|
|
|
|
2021-12-17 01:05:38 -05:00
|
|
|
namespace NVL {
|
2022-08-18 12:17:43 -04:00
|
|
|
using Number = f32;
|
2022-08-22 02:15:25 -04:00
|
|
|
using Char = char16_t;
|
|
|
|
using String = std::u16string;
|
|
|
|
|
|
|
|
static std::wstring_convert<std::codecvt_utf8_utf16<Char>, Char> str_converter;
|
|
|
|
|
|
|
|
inline static std::string to_std_string(const String& s) noexcept { return str_converter.to_bytes(s); }
|
|
|
|
inline static String to_NVL_string(const std::string& s) noexcept { return str_converter.from_bytes(s); }
|
2021-12-17 01:05:38 -05:00
|
|
|
}
|