RML  1.0
Robotics Mathematical Library
Loading...
Searching...
No Matches
futils Namespace Reference

Classes

struct  Dotter
 
struct  FirstOrderFilter
 
struct  Percentage
 
struct  Spinner
 My first functor!!! :D. More...
 
struct  square
 Functor for getting sum of previous result and square of current element (inner product can be used instead) More...
 
struct  Timer
 

Typedefs

template<typename K , typename V >
using MapIterator = typename std::map< K, V >::const_iterator
 

Functions

template<class Object >
void PrettyPrint (const Object &A, std::string name, const char *color=tc::white)
 
int MakeDir (const char *path)
 Create folder if not existing.
 
template<typename T >
std::string toStringPointDecimal (T val)
 
template<typename T >
void PrintArray (T arr, const int size, const char delimiter)
 
template<typename T >
void PrintCMATArray (T arr, const int size, const char delimiter)
 
template<typename T >
std::string ArrayToString (T arr, const int size, const char delimiter)
 
template<typename T >
std::string CMATArrayToString (T arr, const int size, const char delimiter)
 
template<typename T >
void PrintSTLVector (T vecObj, const char delimiter, const std::string preText="")
 
template<typename T >
std::string STLVectorToString (T vecObj, const char delimiter, const std::string preText="")
 
template<typename T >
void PrintSTLVectOfVects (T vecObj, const char delimiter)
 
std::string GetCurrentDateFormatted ()
 
template<typename K , typename V >
bool FindMapKeyByValue (const std::map< K, V > myMap, const V value, K &key)
 
bool CopyFile (const std::string &inputFile, const std::string &outputFile)
 

Detailed Description

Escape sequence \033[m or [m

color : [\033[ m] ]

e.g. bg=Blue, Bold, fg=Red

  1. \033[44;1;31m
  2. \033[44m\033[1;31m

Text attributes 0 All attributes off 1 Bold on 4 Underscore (on monochrome display adapter only) 5 Blink on 7 Reverse video on 8 Concealed on

Foreground colors 0;30 Black 1;30 Dark Gray 0;31 Red 1;31 Light Red 0;32 Green 1;32 Light Green 0;33 Brown 1;33 Yellow 0;34 Blue 1;34 Light Blue 0;35 Purple 1;35 Light Purple 0;36 Cyan 1;36 Light Cyan 0;37 Light Gray 1;37 White

Typedef Documentation

◆ MapIterator

template<typename K , typename V >
using futils::MapIterator = typedef typename std::map<K,V>::const_iterator

Function Documentation

◆ ArrayToString()

template<typename T >
std::string futils::ArrayToString ( arr,
const int  size,
const char  delimiter 
)

◆ CMATArrayToString()

template<typename T >
std::string futils::CMATArrayToString ( arr,
const int  size,
const char  delimiter 
)

◆ CopyFile()

bool futils::CopyFile ( const std::string &  inputFile,
const std::string &  outputFile 
)
inline

◆ FindMapKeyByValue()

template<typename K , typename V >
bool futils::FindMapKeyByValue ( const std::map< K, V >  myMap,
const V  value,
K &  key 
)

◆ GetCurrentDateFormatted()

std::string futils::GetCurrentDateFormatted ( )
inline

Returns the current date and time formatted as Y-m-d_H.M.S

Returns
Current date

◆ MakeDir()

int futils::MakeDir ( const char *  path)
inline

Create folder if not existing.

Parameters
pathof the folder
Returns
0 if success (or folder exists) -1 otherwise (sets errno)

S_IRWXU | S_IRWXG | S_IRWXO Read/write/search permissions for owner and group and others. Since mkdir() masks the mode with umask(), a further chmod() is needed.

◆ PrettyPrint()

template<class Object >
void futils::PrettyPrint ( const Object &  A,
std::string  name,
const char *  color = tc::white 
)

◆ PrintArray()

template<typename T >
void futils::PrintArray ( arr,
const int  size,
const char  delimiter 
)

◆ PrintCMATArray()

template<typename T >
void futils::PrintCMATArray ( arr,
const int  size,
const char  delimiter 
)

◆ PrintSTLVectOfVects()

template<typename T >
void futils::PrintSTLVectOfVects ( vecObj,
const char  delimiter 
)

◆ PrintSTLVector()

template<typename T >
void futils::PrintSTLVector ( vecObj,
const char  delimiter,
const std::string  preText = "" 
)

◆ STLVectorToString()

template<typename T >
std::string futils::STLVectorToString ( vecObj,
const char  delimiter,
const std::string  preText = "" 
)

◆ toStringPointDecimal()

template<typename T >
std::string futils::toStringPointDecimal ( val)
inline