PhoenixInkscape  2.0.0
Generate multiple png files with svg inkscape files
convertToString.cpp
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 
8 #include "convertToString.h"
9 
11 
14 template<>
15 std::string valueToString<std::string>(const std::string & val){
16  return val;
17 }
18 
20 
23 template<>
24 std::string stringToValue<std::string>(const std::string & str){
25  return str;
26 }
27 
29 
32 template<>
33 std::string valueToString<PString>(const PString & val){
34  return val;
35 }
36 
38 
41 template<>
42 PString stringToValue<PString>(const std::string & str){
43  return str;
44 }
45 
47 
50 template<>
51 std::string valueToString<PPath>(const PPath & val){
52  return val;
53 }
54 
56 
59 template<>
60 PPath stringToValue<PPath>(const std::string & str){
61  return PPath(str);
62 }
63 
65 
68 template<>
69 std::string valueToString<bool>(const bool & val){
70  if(val){return "true";}
71  else{return "false";}
72 }
73 
75 
78 template<>
79 bool stringToValue<bool>(const std::string & str){
80  return str == "true" || str == "1" || str == "yes";
81 }
82 
Path of a directory or a file.
Definition: PPath.h:17
Extends the std::string.
Definition: PString.h:16
PPath stringToValue< PPath >(const std::string &str)
Convert a string to value (specialisation for PPath)
std::string valueToString< bool >(const bool &val)
Convert a value to string (specialisation for bool)
PString stringToValue< PString >(const std::string &str)
Convert a string to value (specialisation for PString)
std::string valueToString< PString >(const PString &val)
Convert a value to string (specialisation for PString)
std::string valueToString< PPath >(const PPath &val)
Convert a value to string (specialisation for PPath)
bool stringToValue< bool >(const std::string &str)
Convert a string to value (specialisation for bool)