1
0
mirror of synced 2024-12-12 16:01:06 +01:00
ImHex/plugins/libimhex/include/hex/helpers/lang.hpp

36 lines
692 B
C++

#pragma once
#include <map>
#include <string>
#include <string_view>
namespace hex {
class LangEntry {
public:
LangEntry(const char *unlocalizedString);
operator std::string() const;
operator std::string_view() const;
operator const char*() const;
std::string_view get() const;
static void loadLanguage(std::string_view language);
static const std::map<std::string, std::string>& getSupportedLanguages();
private:
std::string m_unlocalizedString;
};
namespace lang_literals {
LangEntry operator""_lang(const char *string, size_t) {
return LangEntry(string);
}
}
}