ConverterSignedChar.h

Go to the documentation of this file.
00001 // Copyright CERN 2012 - Developed in collaboration with GSI
00002 
00003 #ifndef CONVERTER_SIGNED_CHAR_H_
00004 #define CONVERTER_SIGNED_CHAR_H_
00005 
00006 #include <fesa-core/DataStore/Converter.h>
00007 #include <fesa-core/Utilities/StringUtilities.h>
00008 
00009 #include <string>
00010 
00011 namespace fesa
00012 {
00013 
00019 template<>
00020 class Converter<signed char>
00021 {
00022   public:
00028     static void valueToString(signed char value,std::string& str);
00029 
00035     static void stringToValue(const std::string& value, signed char* pVal);
00036 
00037 };
00038 
00039 inline void Converter<signed char>::valueToString(signed char value,std::string& str)
00040 {
00041     str = StringUtilities::toString((int32_t) value);
00042 }
00043 
00044 inline void Converter<signed char>::stringToValue(const std::string& value, signed char* pVal)
00045 {
00046     int32_t val;
00047     StringUtilities::fromString(val, value);
00048     *pVal = (signed char) val;
00049 }
00050 
00051 } // fesa
00052 
00053 #endif // CONVERTER_SIGNED_CHAR_H_

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1