PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
convertToString.cpp File Reference
#include "convertToString.h"
+ Include dependency graph for convertToString.cpp:

Go to the source code of this file.

Functions

template<>
bool stringToValue< bool > (const std::string &str)
 Convert a string to value (specialisation for bool) More...
 
template<>
PPath stringToValue< PPath > (const std::string &str)
 Convert a string to value (specialisation for PPath) More...
 
template<>
PString stringToValue< PString > (const std::string &str)
 Convert a string to value (specialisation for PString) More...
 
template<>
std::string stringToValue< std::string > (const std::string &str)
 Convert a string to value (specialisation for string) More...
 
template<>
std::string valueToString< bool > (const bool &val)
 Convert a value to string (specialisation for bool) More...
 
template<>
std::string valueToString< PPath > (const PPath &val)
 Convert a value to string (specialisation for PPath) More...
 
template<>
std::string valueToString< PString > (const PString &val)
 Convert a value to string (specialisation for PString) More...
 
template<>
std::string valueToString< std::string > (const std::string &val)
 Convert a value to string (specialisation for string) More...
 

Function Documentation

◆ stringToValue< bool >()

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

Convert a string to value (specialisation for bool)

Parameters
str: string
Returns
string value

Definition at line 79 of file convertToString.cpp.

79  {
80  return str == "true" || str == "1" || str == "yes";
81 }

Referenced by testConvertToString().

+ Here is the caller graph for this function:

◆ stringToValue< PPath >()

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

Convert a string to value (specialisation for PPath)

Parameters
str: string
Returns
string value

Definition at line 60 of file convertToString.cpp.

60  {
61  return PPath(str);
62 }
Path of a directory or a file.
Definition: PPath.h:17

Referenced by testConvertToString().

+ Here is the caller graph for this function:

◆ stringToValue< PString >()

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

Convert a string to value (specialisation for PString)

Parameters
str: string
Returns
string value

Definition at line 42 of file convertToString.cpp.

42  {
43  return str;
44 }

Referenced by testConvertToString().

+ Here is the caller graph for this function:

◆ stringToValue< std::string >()

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

Convert a string to value (specialisation for string)

Parameters
str: string
Returns
string value

Definition at line 24 of file convertToString.cpp.

24  {
25  return str;
26 }

◆ valueToString< bool >()

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

Convert a value to string (specialisation for bool)

Parameters
val: value
Returns
string

Definition at line 69 of file convertToString.cpp.

69  {
70  if(val){return "true";}
71  else{return "false";}
72 }

◆ valueToString< PPath >()

template<>
std::string valueToString< PPath > ( const PPath val)

Convert a value to string (specialisation for PPath)

Parameters
val: value
Returns
string

Definition at line 51 of file convertToString.cpp.

51  {
52  return val;
53 }

Referenced by testConvertToString().

+ Here is the caller graph for this function:

◆ valueToString< PString >()

template<>
std::string valueToString< PString > ( const PString val)

Convert a value to string (specialisation for PString)

Parameters
val: value
Returns
string

Definition at line 33 of file convertToString.cpp.

33  {
34  return val;
35 }

Referenced by testConvertToString().

+ Here is the caller graph for this function:

◆ valueToString< std::string >()

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

Convert a value to string (specialisation for string)

Parameters
val: value
Returns
string

Definition at line 15 of file convertToString.cpp.

15  {
16  return val;
17 }