PhoenixMock  1.8.7
Tools to split/merge/print mock used in Phoenix
convertToString_impl.h
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 #ifndef __CONVERTTOSTRING_IMPL_H__
8 #define __CONVERTTOSTRING_IMPL_H__
9 
10 #include "convertToString.h"
11 
13 
16 template<typename T>
17 std::string convertToString(const T & val){
18  std::stringstream str;
19  str << val;
20  return str.str();
21 }
22 
24 
27 template<typename T>
28 T stringToValue(const std::string & str){
29  std::stringstream strStream;
30  strStream << str;
31  T val;
32  strStream >> val;
33  return val;
34 }
35 
36 
37 #endif
38 
convertToString
std::string convertToString(const T &val)
Convert a type into a string.
Definition: convertToString_impl.h:17
convertToString.h
stringToValue
T stringToValue(const std::string &str)
Convert a string into value.
Definition: convertToString_impl.h:28
createReleaseCurl.str
str
Definition: createReleaseCurl.py:128