btftoolchain
helper::util Namespace Reference

Functions

std::string wstrTostr (const std::wstring &in)
 Converts a wstirng to string. More...
 
std::wstring strTowstr (const std::string &in)
 Converts a string to wstring. More...
 
void getline (std::ifstream &file, std::string &out)
 wrapper for std::getline that removes CR (\r) at the end of the line. More...
 
template<typename To , typename From >
To safe_dynamic_cast (From src) noexcept
 Template to enable a safe dynamic cast by catching nullptr. More...
 

Function Documentation

◆ getline()

void helper::util::getline ( std::ifstream &  file,
std::string &  out 
)

wrapper for std::getline that removes CR (\r) at the end of the line.

Parameters
fileThe input file.
outObject where the extracted line is stored.
Here is the caller graph for this function:

◆ safe_dynamic_cast()

template<typename To , typename From >
To helper::util::safe_dynamic_cast ( From  src)
noexcept

Template to enable a safe dynamic cast by catching nullptr.

◆ strTowstr()

std::wstring helper::util::strTowstr ( const std::string &  in)

Converts a string to wstring.

Parameters
inThe string to be converted.
Returns
The converted wstring.

◆ wstrTostr()

std::string helper::util::wstrTostr ( const std::wstring &  in)

Converts a wstirng to string.

Parameters
inThe wstring to be converted.
Returns
The converted string.