PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
convertToString_impl.h File Reference
#include "convertToString.h"
#include "PString.h"
#include "PPath.h"
+ Include dependency graph for convertToString_impl.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T >
stringToValue (const std::string &str)
 Convert a string into value. More...
 
template<typename T >
std::string valueToString (const T &val)
 Convert a type into a string. More...
 

Function Documentation

◆ stringToValue()

template<typename T >
T stringToValue ( const std::string &  str)

Convert a string into value.

Parameters
str: string to be converted
Returns
converted value

Definition at line 30 of file convertToString_impl.h.

30  {
31  std::stringstream strStream;
32  strStream << str;
33  T val;
34  strStream >> val;
35  return val;
36 }

◆ valueToString()

template<typename T >
std::string valueToString ( const T &  val)

Convert a type into a string.

Parameters
val: value to be converted
Returns
converted string

Definition at line 19 of file convertToString_impl.h.

19  {
20  std::stringstream str;
21  str << val;
22  return str.str();
23 }

Referenced by checkResultConvertToString(), PString::fromValue(), getSlideNumber(), openFileStream(), PString::operator+=(), PString::operator<<(), PString::operator=(), phoenix_check(), phoenix_save_value_to_dico(), PLog::resize(), testConvertToString(), and PString::toString().

+ Here is the caller graph for this function: