2#include <cosmos/error/ApiError.hxx>
3#include <cosmos/locale.hxx>
4#include <cosmos/utils.hxx>
6namespace cosmos::locale {
9 auto get_cat(Category cat) {
10 return to_integral(cat);
14std::string get(Category category) {
17 char *locale = ::setlocale(get_cat(category),
nullptr);
21void set(Category category,
const SysString val) {
22 if (::setlocale(get_cat(category), val.raw()) ==
nullptr) {
23 cosmos_throw (ApiError(
"setlocale()"));
27void set_to_default(Category category) {
31void set_from_environment(Category category) {