AnCH Framework 0.1
Another C++ Hack Framework
 
Loading...
Searching...
No Matches
anch Namespace Reference

AnCH framework base namespace. More...

Namespaces

namespace  crypto
 Cryptography namespace.
 
namespace  date
 Date namespace.
 
namespace  device
 Device management namespace.
 
namespace  events
 Events management namespace.
 
namespace  json
 JSON namespace.
 
namespace  logger
 Logger namespace.
 
namespace  network
 Network namespace.
 
namespace  resource
 Resources namespace.
 
namespace  sql
 SQL 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...
 
class  Optional
 std::optional usefull methods. More...
 
class  Singleton
 Meyers' singleton implementation. More...
 
class  ThreadPool
 Thread pool utility class. More...
 
class  UUID
 UUID generator and parser. More...
 

Functions

template<typename N>
convert (const std::string &str)
 
template<typename T>
void byteSwap (T src, uint8_t *dest)
 
bool isBigEndian ()
 
bool isLittleEndian ()
 
template<typename T>
void applyIfValue (std::optional< T > &value, std::function< void(const T &)> func)
 
template<typename T>
void applyIfValueOrElse (std::optional< T > &value, std::function< void(const T &)> func, std::function< void()> fallback)
 
void toLower (std::string &value)
 
void toUpper (std::string &value)
 

Detailed Description

AnCH framework base namespace.

Contains utility classes from AnCH utils and UUID libraries.

Function Documentation

◆ applyIfValue()

template<typename T>
void anch::applyIfValue ( std::optional< T > & value,
std::function< void(const T &)> func )
inline

Apply treatment if optional has value

Parameters
valuethe optional value
functhe treatment to apply when optional has value

◆ applyIfValueOrElse()

template<typename T>
void anch::applyIfValueOrElse ( std::optional< T > & value,
std::function< void(const T &)> func,
std::function< void()> fallback )
inline

Apply treatment if optional has value or apply fallback treatment

Parameters
valuethe optional value
functhe treatment to apply when optional has value
fallbackthe treatment to apply when optional has no value

◆ byteSwap()

template<typename T>
void anch::byteSwap ( T src,
uint8_t * dest )

Switch data endianness.

Parameters
srcthe object to convert
destthe converted bytes
Since
0.1
Author
Vincent Lachenal

◆ convert()

template<typename N>
N anch::convert ( const std::string & str)

Performs strict conversion from std::string to number

Parameters
strthe string to convert
Returns
the number
Exceptions
std::bad_castconversion error

◆ isBigEndian()

bool anch::isBigEndian ( )

Check if system is in big endian bytes order.

Returns
true if system is big endian, false otherwise
Since
0.1
Author
Vincent Lachenal

◆ isLittleEndian()

bool anch::isLittleEndian ( )

Check if system is in little endian bytes order.

Returns
true if system is little endian, false otherwise
Since
0.1
Author
Vincent Lachenal

◆ toLower()

void anch::toLower ( std::string & value)

Transform input string to lower caser

Parameters
valuethe string to transform

◆ toUpper()

void anch::toUpper ( std::string & value)

Transform input string to upper caser

Parameters
valuethe string to transform