Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
Util.h File Reference

Miscellaneous utility functions. More...

#include "sese/Config.h"
#include "sese/io/InputStream.h"
#include "sese/io/OutputStream.h"
#include <chrono>
#include <thread>

Go to the source code of this file.

Classes

struct  sese::StrCmp
 Character comparator. More...
 
struct  sese::StrCmpI
 Character comparator (case-insensitive) More...
 

Namespaces

namespace  sese
 

Macros

#define CheckRange(x, max)   ((unsigned int) (x) < (max))
 Faster boundary check - [0, max)
 
#define CheckRangeBetween(x, min, max)   (((x) - (min)) | ((max) - (x)) >= 0)
 Faster boundary check - [min, max].
 

Functions

int64_t sese::toInteger (const std::string &string, int radix=10)
 
std::string sese::getClassName (const std::type_info *type)
 
bool sese::strcmp (char const *lv, char const *rv) noexcept
 
bool sese::strcmpDoNotCase (char const *lv, char const *rv) noexcept
 
bool sese::isSpace (char ch) noexcept
 
const char * sese::getLevelString (Level level) noexcept
 
int32_t sese::findFirstAt (const char *str, char ch)
 
void sese::sleep (uint32_t second)
 
template<class REP , class PERIOD >
void sese::sleep (const std::chrono::duration< REP, PERIOD > &duration)
 
std::string sese::getErrorString (int64_t error=errno)
 
int32_t sese::getErrorCode ()
 
size_t sese::streamMove (sese::io::OutputStream *out, sese::io::InputStream *in, size_t size) noexcept
 
template<class T >
size_t sese::number2StringLength (T num, size_t radix=10)
 
template<class T >
size_t sese::floating2StringLength (T num, uint16_t placeholder)
 
template<typename TP >
std::time_t sese::to_time_t (TP tp)
 
template<typename T >
bool sese::isAdditionOverflow (T a, T b)
 Additive spill detection.
 
template<typename T >
bool sese::isSubtractionOverflow (T a, T b)
 Subtractive spill detection.
 
const char * getSpecificVersion ()
 

Detailed Description

Miscellaneous utility functions.

Author
kaoru
Date
March 28, 2022

Macro Definition Documentation

◆ CheckRange

#define CheckRange ( x,
max )   ((unsigned int) (x) < (max))

◆ CheckRangeBetween

#define CheckRangeBetween ( x,
min,
max )   (((x) - (min)) | ((max) - (x)) >= 0)

Faster boundary check - [min, max].

Function Documentation

◆ getSpecificVersion()

const char * getSpecificVersion ( )

Retrieve detailed information (C interface)

Returns
Version information string