KIDS  ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
utils Namespace Reference

Namespaces

namespace  sep
 

Classes

struct  separator_t
 

Functions

template<typename CharT >
constexpr separator_t< CharT > separator (const CharT *s)
 
template<typename CharT = char, typename... Args>
std::basic_string< CharT > concat (const separator_t< CharT > &sep, Args &&... seq)
 
template<char head, char... tail, typename F , typename... Args, typename = enable_if_t<!std::is_same<F, separator_t<char>>::value, F>>
std::basic_string< char > concat (F &&first, Args &&... rest)
 
template<const char * sep, typename F , typename... Args, typename = enable_if_t<!std::is_same<F, separator_t<char>>::value, F>>
std::basic_string< char > concat (F &&first, Args &&... rest)
 
template<typename CharT = char, typename F , typename... Args, typename = enable_if_t<!std::is_same<F, separator_t<CharT>>::value, F>>
std::basic_string< CharT > concat (F &&first, Args &&... rest)
 
template<std::ostream & sep, typename CharT = char, typename F , typename... Args, typename = enable_if_t<!std::is_same<F, separator_t<CharT>>::value, F>>
std::basic_string< CharT > concat (F &&first, Args &&... rest)
 
constexpr uint32_t fnv1a (const char *str, uint32_t hash=2166136261u)
 
constexpr uint32_t hash (const char *str)
 
int removeFile (std::string &filename)
 
void clearFile (std::string &filename)
 
void closeOFS (std::ofstream &ofs)
 
bool isFileExists (const std::string &name)
 
std::string ParseFilePath (const std::string &s)
 
std::string ParseFileName (const std::string &s)
 
std::string ParseFileExtension (const std::string &s)
 
int copyfile_from_to (const std::string &from, const std::string &to)
 

Function Documentation

◆ clearFile()

void utils::clearFile ( std::string & filename)
inline

Definition at line 23 of file io_utils.h.

◆ closeOFS()

void utils::closeOFS ( std::ofstream & ofs)
inline

Definition at line 25 of file io_utils.h.

◆ concat() [1/5]

◆ concat() [2/5]

template<char head, char... tail, typename F , typename... Args, typename = enable_if_t<!std::is_same<F, separator_t<char>>::value, F>>
std::basic_string< char > utils::concat ( F && first,
Args &&... rest )

Definition at line 249 of file concat.h.

◆ concat() [3/5]

template<const char * sep, typename F , typename... Args, typename = enable_if_t<!std::is_same<F, separator_t<char>>::value, F>>
std::basic_string< char > utils::concat ( F && first,
Args &&... rest )

Definition at line 256 of file concat.h.

◆ concat() [4/5]

template<typename CharT = char, typename F , typename... Args, typename = enable_if_t<!std::is_same<F, separator_t<CharT>>::value, F>>
std::basic_string< CharT > utils::concat ( F && first,
Args &&... rest )

Definition at line 263 of file concat.h.

◆ concat() [5/5]

template<std::ostream & sep, typename CharT = char, typename F , typename... Args, typename = enable_if_t<!std::is_same<F, separator_t<CharT>>::value, F>>
std::basic_string< CharT > utils::concat ( F && first,
Args &&... rest )

Definition at line 270 of file concat.h.

◆ copyfile_from_to()

int utils::copyfile_from_to ( const std::string & from,
const std::string & to )
inline

Definition at line 55 of file io_utils.h.

◆ fnv1a()

constexpr uint32_t utils::fnv1a ( const char * str,
uint32_t hash = 2166136261u )
constexpr

Definition at line 8 of file hash_fnv1a.h.

References fnv1a(), and hash().

Referenced by fnv1a(), and hash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hash()

◆ isFileExists()

bool utils::isFileExists ( const std::string & name)
inline

Definition at line 29 of file io_utils.h.

◆ ParseFileExtension()

std::string utils::ParseFileExtension ( const std::string & s)
inline

Definition at line 48 of file io_utils.h.

References DELIM_SEP.

◆ ParseFileName()

std::string utils::ParseFileName ( const std::string & s)
inline

Definition at line 42 of file io_utils.h.

References DELIM_SEP.

◆ ParseFilePath()

std::string utils::ParseFilePath ( const std::string & s)
inline

Definition at line 37 of file io_utils.h.

References DELIM_SEP.

◆ removeFile()

int utils::removeFile ( std::string & filename)
inline

Definition at line 21 of file io_utils.h.

◆ separator()

template<typename CharT >
constexpr separator_t< CharT > utils::separator ( const CharT * s)
constexpr

Definition at line 27 of file concat.h.