libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
ttypes.hpp File Reference
#include "config.h"
#include "debug_defines.hpp"
#include <cassert>
#include <cinttypes>
#include <cmath>
#include <algorithm>
#include <functional>
#include <istream>
#include <iterator>
#include <ostream>
#include <sstream>
#include <string>
Include dependency graph for ttypes.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  jmmcg::LIBJMMCG_VER_NAMESPACE::upperletter< T >
 A simple class to turn a character into upper case according to the current locale settings. More...
 
class  jmmcg::LIBJMMCG_VER_NAMESPACE::lowerletter< T >
 A simple class to turn a character into lowercase according to the current locale settings. More...
 

Namespaces

namespace  jmmcg
 Link with -lrt to include these functions.
 
namespace  jmmcg::LIBJMMCG_VER_NAMESPACE
 

Macros

#define TCHAR   jmmcg::LIBJMMCG_VER_NAMESPACE::tchar;
 
#define _TCHAR_DEFINED
 
#define _T(str)   str
 
#define tsscanf   sscanf
 
#define tstrlen   strlen
 

Typedefs

typedef char jmmcg::LIBJMMCG_VER_NAMESPACE::tchar
 
typedef std::basic_string< tchar > jmmcg::LIBJMMCG_VER_NAMESPACE::tstring
 
typedef std::basic_stringstream< tchar > jmmcg::LIBJMMCG_VER_NAMESPACE::tstringstream
 
typedef std::basic_istringstream< tchar > jmmcg::LIBJMMCG_VER_NAMESPACE::tistringstream
 
typedef std::basic_ostringstream< tchar > jmmcg::LIBJMMCG_VER_NAMESPACE::tostringstream
 
typedef std::basic_istream< tchar > jmmcg::LIBJMMCG_VER_NAMESPACE::tistream
 
typedef std::basic_ostream< tchar > jmmcg::LIBJMMCG_VER_NAMESPACE::tostream
 

Functions

constexpr std::uint32_t jmmcg::LIBJMMCG_VER_NAMESPACE::num_digits_in_base10 (std::uint64_t v) noexcept(true) __attribute__((pure))
 Returns the number of digits in the base 10 representation of an uint64_t. More...
 
std::uint32_t jmmcg::LIBJMMCG_VER_NAMESPACE::uint64ToBufferUnsafe (std::uint64_t v, char *const buffer, [[maybe_unused]] std::uint32_t sz) noexcept(true) __attribute__((pure))
 Copies the ASCII base 10 representation of v into the buffer and returns the number of bytes written. More...
 
std::uint64_t jmmcg::LIBJMMCG_VER_NAMESPACE::folly_ascii_to_int (char const *buffer, std::uint32_t sz) noexcept(true) __attribute__((pure))
 Returns the ASCII base 10 representation in the buffer. More...
 
template<unsigned Base>
std::uint64_t jmmcg::LIBJMMCG_VER_NAMESPACE::ascii_to_int_baseline (char const *const buffer, std::size_t sz) noexcept(true) __attribute__((pure))
 Returns the ASCII base 10 representation in the buffer. More...
 
template<typename T >
tstring __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::tostring (const T &val)
 
template<std::size_t N>
tstring __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::tostring (const std::array< tstring::value_type, N > &val)
 
template<>
tstring __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::tostring< tstring > (const tstring &val)
 
template<typename A , typename Fmt >
tstring __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::tostring (const A &a, const Fmt &format)
 
template<std::size_t Sz>
constexpr std::size_t FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::tostring (std::uint64_t v, char(&buff)[Sz]) noexcept(true) __attribute__((pure))
 Convert the input value to a string stored in the supplied buffer. More...
 
template<std::uint8_t Base, std::size_t Sz>
constexpr std::size_t FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::tostring_zero_pad_right_justify (std::uint32_t v, char(&buff)[Sz]) noexcept(true) __attribute__((pure))
 Convert the input value to a string stored in the supplied buffer. More...
 
template<std::size_t Sz>
constexpr std::size_t FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::tostring (std::int64_t v, char(&buff)[Sz]) noexcept(true) __attribute__((pure))
 Convert the input value to a string stored in the supplied buffer. More...
 
template<class V >
std::size_t jmmcg::LIBJMMCG_VER_NAMESPACE::tostring (V v, char *const buff, std::size_t sz) noexcept(true)=delete
 
template<>
std::size_t jmmcg::LIBJMMCG_VER_NAMESPACE::tostring< int > (int v, char *const buff, std::size_t sz) noexcept(true) __attribute__((pure))
 Convert the input value to a string stored in the supplied buffer. More...
 
template<>
std::size_t jmmcg::LIBJMMCG_VER_NAMESPACE::tostring< unsigned int > (unsigned int v, char *const buff, std::size_t sz) noexcept(true) __attribute__((pure))
 Convert the input value to a string stored in the supplied buffer. More...
 
template<>
std::size_t jmmcg::LIBJMMCG_VER_NAMESPACE::tostring< long > (long v, char *const buff, std::size_t sz) noexcept(true) __attribute__((pure))
 Convert the input value to a string stored in the supplied buffer. More...
 
template<>
std::size_t jmmcg::LIBJMMCG_VER_NAMESPACE::tostring< unsigned long > (unsigned long v, char *const buff, std::size_t sz) noexcept(true) __attribute__((pure))
 Convert the input value to a string stored in the supplied buffer. More...
 
std::size_t jmmcg::LIBJMMCG_VER_NAMESPACE::tostring (std::uint32_t v, char *const buff, std::size_t sz) noexcept(true) __attribute__((pure))
 Convert the input value to a string stored in the supplied buffer. More...
 
std::size_t jmmcg::LIBJMMCG_VER_NAMESPACE::tostring (std::int64_t v, char *const buff, std::size_t sz) noexcept(true) __attribute__((pure))
 Convert the input value to a string stored in the supplied buffer. More...
 
std::size_t jmmcg::LIBJMMCG_VER_NAMESPACE::tostring (std::uint64_t v, char *const buff, std::size_t sz) noexcept(true) __attribute__((pure))
 Convert the input value to a string stored in the supplied buffer. More...
 
std::size_t jmmcg::LIBJMMCG_VER_NAMESPACE::tostring (double v, char *const buff, std::size_t sz) noexcept(true)
 Convert the input value to a string stored in the supplied buffer. More...
 
template<typename T >
void __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::fromstring (const tstring &str, T &val)
 
template<>
void __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::fromstring< tstring > (const tstring &str, tstring &val)
 
template<class V >
std::enable_if< std::is_integral< V >::value||std::is_floating_point< V >::value, V >::type jmmcg::LIBJMMCG_VER_NAMESPACE::fromstring (char const *const, std::uint32_t) noexcept(true) __attribute__((pure))=delete
 
template<>
int jmmcg::LIBJMMCG_VER_NAMESPACE::fromstring< int > (char const *const begin, std::uint32_t sz) noexcept(true) __attribute__((pure))
 Convert the decimal value contained in the input string into an integral value. More...
 
template<>
unsigned int jmmcg::LIBJMMCG_VER_NAMESPACE::fromstring< unsigned int > (char const *const begin, std::uint32_t sz) noexcept(true) __attribute__((pure))
 Convert the decimal value contained in the input string into an integral value. More...
 
template<>
long jmmcg::LIBJMMCG_VER_NAMESPACE::fromstring< long > (char const *const begin, std::uint32_t sz) noexcept(true) __attribute__((pure))
 Convert the decimal value contained in the input string into an integral value. More...
 
template<>
unsigned long jmmcg::LIBJMMCG_VER_NAMESPACE::fromstring< unsigned long > (char const *const begin, std::uint32_t sz) noexcept(true) __attribute__((pure))
 Convert the decimal value contained in the input string into an integral value. More...
 
template<>
long long jmmcg::LIBJMMCG_VER_NAMESPACE::fromstring< long long > (char const *const begin, std::uint32_t sz) noexcept(true) __attribute__((pure))
 Convert the decimal value contained in the input string into an integral value. More...
 
template<>
unsigned long long jmmcg::LIBJMMCG_VER_NAMESPACE::fromstring< unsigned long long > (char const *const begin, std::uint32_t sz) noexcept(true) __attribute__((pure))
 Convert the decimal value contained in the input string into an integral value. More...
 
template<>
double jmmcg::LIBJMMCG_VER_NAMESPACE::fromstring< double > (char const *const begin, std::uint32_t) noexcept(true) __attribute__((pure))
 Convert the decimal value contained in the input string into an integral value. More...
 
template<typename T >
void __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::delete_ptr (T *ptr)
 
tstring jmmcg::LIBJMMCG_VER_NAMESPACE::toupper (const tstring &l)
 Turn the input string into an uppercase variant according to the current locale settings. More...
 
tstring jmmcg::LIBJMMCG_VER_NAMESPACE::tolower (const tstring &u)
 Turn the input string into a lowercase variant according to the current locale settings. More...
 
template<class Iter >
Iter jmmcg::LIBJMMCG_VER_NAMESPACE::toupper (const Iter b, const Iter e, Iter o)
 Turn the input range into an uppercase variant according to the current locale settings. More...
 
template<class Iter >
Iter jmmcg::LIBJMMCG_VER_NAMESPACE::tolower (const Iter b, const Iter e, Iter o)
 Turn the input range into a lowercase variant according to the current locale settings. More...
 
template<std::size_t Sz>
jmmcg::LIBJMMCG_VER_NAMESPACE::tostream &__fastcall std::operator<< (jmmcg::LIBJMMCG_VER_NAMESPACE::tostream &o, std::array< jmmcg::LIBJMMCG_VER_NAMESPACE::tstring::value_type, Sz > const &val)
 
std::ostream &__fastcall std::operator<< (std::ostream &o, std::exception_ptr ex) noexcept(false)
 

Macro Definition Documentation

◆ _T

#define _T (   str)    str

Definition at line 63 of file ttypes.hpp.

◆ _TCHAR_DEFINED

#define _TCHAR_DEFINED

Definition at line 45 of file ttypes.hpp.

◆ TCHAR

Definition at line 44 of file ttypes.hpp.

◆ tsscanf

#define tsscanf   sscanf

Definition at line 64 of file ttypes.hpp.

◆ tstrlen

#define tstrlen   strlen

Definition at line 65 of file ttypes.hpp.

Function Documentation

◆ operator<<() [1/2]

template<std::size_t Sz>
jmmcg::LIBJMMCG_VER_NAMESPACE::tostream& __fastcall std::operator<< ( jmmcg::LIBJMMCG_VER_NAMESPACE::tostream o,
std::array< jmmcg::LIBJMMCG_VER_NAMESPACE::tstring::value_type, Sz > const &  val 
)
inline

Definition at line 688 of file ttypes.hpp.

◆ operator<<() [2/2]

std::ostream& __fastcall std::operator<< ( std::ostream &  o,
std::exception_ptr  ex 
)
inlinenoexcept

Definition at line 698 of file ttypes.hpp.