SA_Logger
Sapphire's Suite's C++ Logger.
Loading...
Searching...
No Matches
Functions
ToString.hpp File Reference

Definition of Sapphire ToString methods. More...

#include <cstdint>
#include <string>
#include <vector>
#include <SA/Logger/Misc/ToString.inl>

Go to the source code of this file.

Functions

template<typename T >
std::string SA::ToStringBinary (const T &_elem) noexcept
 Binary ToString implementation.
 
template<typename T >
std::string SA::ToString (const T &_elem)
 ToString default implementation used to print elem.
 
template<typename T >
std::string SA::ToString (T *_ptr)
 ToString implementation used to print a pointer.
 
template<typename T >
std::string SA::ToString (const T *_elems, uint64_t _size)
 ToString implementation used to print an array.
 
template<typename T >
std::string SA::ToString (const std::vector< T > &_vec)
 ToString implementation used to print a vector.
 
template<typename T >
std::wstring SA::ToWString (const T &_elem) noexcept
 ToWString default implementation used to print elem.
 
template<typename T >
std::wstring SA::ToWString (T *_ptr) noexcept
 ToWString implementation used to print a pointer.
 
template<typename T >
std::wstring SA::ToWString (const T *_elems, uint64_t _size)
 ToWString implementation used to print an array.
 
template<typename T >
std::wstring SA::ToWString (const std::vector< T > &_vec)
 ToWString implementation used to print a vector.
 

Detailed Description

Definition of Sapphire ToString methods.

Function Documentation

◆ ToString() [1/4]

template<typename T >
std::string SA::ToString ( const std::vector< T > & _vec)

ToString implementation used to print a vector.

Template Parameters
TType of the vector.
Parameters
[in]_vecVector to convert to string.
Returns
std::string from vector converted.

◆ ToString() [2/4]

template<typename T >
std::string SA::ToString ( const T & _elem)

ToString default implementation used to print elem.

Convert basic types to string, otherwise make binary conversion.

Template Parameters
TType of element.
Parameters
[in]_elemElement to convert to string.
Returns
std::string from element converted.

◆ ToString() [3/4]

template<typename T >
std::string SA::ToString ( const T * _elems,
uint64_t _size )

ToString implementation used to print an array.

Template Parameters
TType of the array.
Parameters
[in]_elemsArray pointer to convert to string.
[in]_sizeSize of the array.
Returns
std::string from array converted.

◆ ToString() [4/4]

template<typename T >
std::string SA::ToString ( T * _ptr)

ToString implementation used to print a pointer.

Template Parameters
TType of the pointer.
Parameters
[in]_ptrPointer to convert to string.
Returns
std::string from pointer converted.

◆ ToStringBinary()

template<typename T >
std::string SA::ToStringBinary ( const T & _elem)
noexcept

Binary ToString implementation.

Convert elem into bit array and print as hex values.

Template Parameters
TType of element.
Parameters
[in]_elemElement to convert to string.
Returns
std::string from element converted in binary.

◆ ToWString() [1/4]

template<typename T >
std::wstring SA::ToWString ( const std::vector< T > & _vec)

ToWString implementation used to print a vector.

Template Parameters
TType of the vector.
Parameters
[in]_vecVector to convert to wstring.
Returns
std::wstring from vector converted.

◆ ToWString() [2/4]

template<typename T >
std::wstring SA::ToWString ( const T & _elem)
noexcept

ToWString default implementation used to print elem.

Convert basic types to wstring, otherwise make binary conversion.

Template Parameters
TType of element.
Parameters
[in]_elemElement to convert to wstring.
Returns
std::wstring from element converted.

◆ ToWString() [3/4]

template<typename T >
std::wstring SA::ToWString ( const T * _elems,
uint64_t _size )

ToWString implementation used to print an array.

Template Parameters
TType of the array.
Parameters
[in]_elemsArray pointer to convert to wstring.
[in]_sizeSize of the array.
Returns
std::wstring from array converted.

◆ ToWString() [4/4]

template<typename T >
std::wstring SA::ToWString ( T * _ptr)
noexcept

ToWString implementation used to print a pointer.

Template Parameters
TType of pointer.
Parameters
[in]_ptrPointer to convert to wstring.
Returns
std::wstring from pointer converted.