AnCH framework base namespace. More...
Namespaces | |
| namespace | cli |
| AnCH command line interface library namespace. | |
| namespace | codec |
| AnCH codec library namespace. | |
| namespace | conf |
| AnCH configuration library namespace. | |
| namespace | crypto |
| Cryptography namespace. | |
| namespace | csv |
| AnCH CSV library namespace. | |
| namespace | cutils |
| AnCH C utilities library namespace. | |
| namespace | date |
| Dates namespace. | |
| namespace | device |
| Device management namespace. | |
| namespace | events |
| Events management namespace. | |
| namespace | ini |
| AnCH INI library namespace. | |
| namespace | json |
| JSON namespace. | |
| namespace | log |
| AnCH logging library namespace. | |
| namespace | network |
| Network namespace. | |
| namespace | oas |
| OpenAPI namespace. | |
| namespace | rest |
| AnCH REST library namespace. | |
| namespace | sql |
| SQL namespace. | |
| namespace | ut |
| AnCH unit tests library namespace. | |
| namespace | val |
| AnCH validation library namespace. | |
Classes | |
| class | Collectors |
| Stream collector functions. More... | |
| class | Fluent |
| Java style fuent class. More... | |
| class | Flux |
| Manage collection as stream. More... | |
| struct | LessPtrCompare |
| Less comparator based on object address. More... | |
| struct | Mapping |
| Description of an object for every format (anch-json, ...). More... | |
| class | Optional |
std::optional usefull methods. More... | |
| class | PoolableResource |
| Generic poolable resource. More... | |
| class | ResourcePool |
| Generic resource pool utility class. More... | |
| struct | ResourcePoolState |
| Resource pool shared state (internal usage). More... | |
| class | Singleton |
| Meyers' singleton implementation. More... | |
| class | ThreadPool |
| Thread pool utility class. More... | |
| class | TimeoutException |
| Timeout exception. More... | |
| class | UUID |
| UUID generator and parser. More... | |
Concepts | |
| concept | Convertible |
| concept | Described |
| Type described by an anch::Mapping specialization. | |
| concept | ObjectMapper |
Mapper of a format on which anch::Mapping registers the fields of T. | |
| concept | Releasable |
| concept | Validable |
Functions | |
| template<anch::Convertible N> | |
| N | convert (std::string_view str) |
| template<anch::Convertible N> | |
| std::expected< N, std::errc > | tryConvert (std::string_view str) noexcept |
| template<std::integral T> | |
| void | byteSwap (T src, uint8_t *dest) noexcept |
| constexpr bool | isBigEndian () noexcept |
| constexpr bool | isLittleEndian () noexcept |
| template<anch::Described T, anch::ObjectMapper< T > M> | |
| void | describe (M &mapper) |
| template<typename T> | |
| void | applyIfValue (const std::optional< T > &value, std::function< void(const T &)> func) |
| template<typename T> | |
| void | applyIfValueOrElse (const std::optional< T > &value, std::function< void(const T &)> func, std::function< void()> fallback) |
| void | toLower (std::string &value) |
| void | toUpper (std::string &value) |
AnCH framework base namespace.
Contains utility classes from AnCH utils and UUID libraries.
| void anch::applyIfValue | ( | const std::optional< T > & | value, |
| std::function< void(const T &)> | func ) |
Apply treatment if optional has value
| value | the optional value |
| func | the treatment to apply when optional has value |
| void anch::applyIfValueOrElse | ( | const std::optional< T > & | value, |
| std::function< void(const T &)> | func, | ||
| std::function< void()> | fallback ) |
Apply treatment if optional has value or apply fallback treatment
| value | the optional value |
| func | the treatment to apply when optional has value |
| fallback | the treatment to apply when optional has no value |
|
noexcept |
Switch data endianness.
Write the sizeof(T) bytes of src in reverse order into dest (dest can overlap src storage).
| src | the integer to convert |
| dest | the converted bytes (at least sizeof(T) bytes) |
| N anch::convert | ( | std::string_view | str | ) |
Performs strict conversion from string to number.
The whole string has to be a number: leading or trailing characters (including spaces and '+' sign) are rejected.
The conversion does not depend on locale. Negative values are rejected for unsigned types and out of range values are rejected. int8_t and uint8_t are converted as numbers (not as characters).
Floating point values can be written in fixed or scientific notation, and can be inf or nan.
| str | the string to convert |
| std::bad_cast | conversion error |
| void anch::describe | ( | M & | mapper | ) |
Register the fields of a described type on a mapper (used by formats)
| T | the described type |
| M | the mapper type |
| mapper | the mapper |
|
constexprnoexcept |
Check if system is in big endian bytes order.
true if system is big endian, false otherwise
|
constexprnoexcept |
Check if system is in little endian bytes order.
true if system is little endian, false otherwise| void anch::toLower | ( | std::string & | value | ) |
Transform input string to lower case, byte per byte with std::tolower .
The conversion depends on the global C locale (std::setlocale ): only ASCII letters are converted with the default "C" locale ; multibyte characters (UTF-8) are not converted.
| value | the string to transform |
| void anch::toUpper | ( | std::string & | value | ) |
Transform input string to upper case, byte per byte with std::toupper .
The conversion depends on the global C locale (std::setlocale ): only ASCII letters are converted with the default "C" locale ; multibyte characters (UTF-8) are not converted.
| value | the string to transform |
|
noexcept |
Performs strict conversion from string to number without exception.
Same rules as convert: the whole string has to be a number (no leading or trailing characters, no space, no '+' sign), conversion does not depend on locale, negative values are rejected for unsigned types.
| str | the string to convert |
std::errc::invalid_argument (empty string, not a number, leading or trailing characters) or std::errc::result_out_of_range (value out of type range)