libcosmos
Linux C++ System Programming Library
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
locale.hxx
Go to the documentation of this file.
1#pragma once
2
3// libc
4#include <locale.h>
5
6// C++
7#include <string>
8
9// cosmos
10#include <cosmos/dso_export.h>
11#include <cosmos/SysString.hxx>
12
13namespace cosmos::locale {
14
27enum class Category : int {
28 ALL = LC_ALL,
29 COLLATE = LC_COLLATE,
30 CTYPE = LC_CTYPE,
31 MESSAGES = LC_MESSAGES,
32 MONETARY = LC_MONETARY,
33 NUMERIC = LC_NUMERIC,
34 TIME = LC_TIME
35#ifdef LC_ADDRESS /* the following are GNU extensions */
36 ,ADDRESS = LC_ADDRESS,
37 IDENTIFICATION = LC_IDENTIFICATION,
38 MEASUREMENT = LC_MEASUREMENT,
39 NAME = LC_NAME,
40 PAPER = LC_PAPER,
41 TELEPHONE = LC_TELEPHONE
42#endif
43};
44
46COSMOS_API std::string get(Category category);
47
49
52COSMOS_API void set(Category category, const SysString val);
53
55COSMOS_API void set_to_default(Category category);
56
58
62COSMOS_API void set_from_environment(Category category);
63
64} // end ns
Category
Different Locale Categories that can be configured.
Definition locale.hxx:27
@ CTYPE
character classification (e.g. alphanumeric, numeric, ...)
@ TIME
formatting of date and time values
@ ALL
all aspects of the locale
@ NUMERIC
non-monetary numeric values
@ MESSAGES
natural language messages
@ MONETARY
formatting of monetary values
@ COLLATE
comparison of strings
Wrapper type around a C-style string for use with system APIs.
Definition SysString.hxx:33