Core_unix.LocaleLocale.
Encapsulates a POSIX locale_t, i.e. a set of language and cultural conventions for dealing with formatting of strings, numbers, dates, times, money, and so on.
It cannot represent the special constants LC_GLOBAL_LOCALE, representing the current global locale, nor (locale_t)0, sometimes used to mean the current thread-local locale.
Most of the operations can raise exceptions, but only in the case of misusing the API or a likely fatal situation such as out-of-memory, so the names are not explicitly suffixed with _exn.
module Category : sig ... endmodule Category_set : sig ... endmodule Name : sig ... endConstants for names of standard locales which always exist (in any category).
include sig ... endinclude Ppx_compare_lib.Comparable.S with type t := tinclude Ppx_compare_lib.Comparable.S__local with type t := tinclude Ppx_compare_lib.Equal.S with type t := tinclude Ppx_compare_lib.Equal.S__local with type t := tinclude Ppx_hash_lib.Hashable.S_any with type t := tinclude Sexplib0.Sexpable.S with type t := tinclude Sexplib0.Sexpable.Of_sexp with type t := tval t_of_sexp : Sexplib0.Sexp.t -> tinclude Sexplib0.Sexpable.Sexp_of with type t := tval sexp_of_t : t -> Sexplib0.Sexp.tinclude Core.Hashable.S_plain with type t := tinclude Ppx_compare_lib.Comparable.S with type t := tinclude Ppx_hash_lib.Hashable.S_any with type t := tval hash_fold_t : t Ppx_hash_lib.hash_foldval hash : t -> Ppx_hash_lib.Std.Hash.hash_valueval hashable : t Base.Hashable.tmodule Table : Core.Hashtbl.S_plain with type key = tmodule Hash_set : Core.Hash_set.S_plain with type elt = tmodule Hash_queue : Core.Hash_queue.S with type key = tval posix : t Core.Lazy.tA singleton locale created with Expert.posix to avoid having to repeatedly construct it. As a result, the destructive operations like Expert.modify and Expert.free must not be called on this locale, as it would interfere with other users.
val native : t Core.Lazy.tA singleton locale created with Expert.native to avoid having to repeatedly construct it. As a result, the destructive operations like Expert.modify and Expert.free must not be called on this locale, as it would interfere with other users.
module Portable : sig ... endval to_string : t -> Category.t -> stringReturns a string representation of the setting of a single category within a locale, in an implementation-defined format that is accepted by Expert.create.
val to_string_hum : t -> stringReturns a human-readable string of the settings of all of the POSIX-standard locale categories within a locale.
val with_ :
?base:t ->
?category_mask:Category_set.t ->
string ->
(t -> 'a) @ local once ->
'aCreates a t using Expert.create, calls the provided function with it, and frees it afterwards. Be careful when using it with a Deferred.t-returning function, as it would not wait on the Deferred.t before cleaning up.
val with_multi :
?base:t ->
(Category_set.t * string) list ->
(t -> 'a) @ local once ->
'aCreates a t using Expert.create_multi, calls the provided function with it, and frees it afterwards. Be careful when using it with a Deferred.t-returning function, as it would not wait on the Deferred.t before cleaning up.
Creates a t using Expert.copy, calls the provided function with it, and frees it afterwards. Be careful when using it with a Deferred.t-returning function, as it would not wait on the Deferred.t before cleaning up.
val get_current : unit -> t optionReturns the current thread-local locale, or None if the thread-local locale is dynamically tracking the global locale. This gives a direct reference rather than a snapshot.
val with_current : t option -> (unit -> 'a) @ local once -> 'aSets the current locale using Expert.set_current, calls the provided function, and restores the current locale to its previous value afterwards. Be careful when using it with a Deferred.t-returning function, as it would not wait on the Deferred.t before cleaning up.
module Expert : sig ... end