Video Processing Framework
D:/J_PROGRAMI/SPLINEPROJECT/CODE2/Util_YAML/include/yaml-cpp/conversion.h
Go to the documentation of this file.
00001 #ifndef CONVERSION_H_62B23520_7C8E_11DE_8A39_0800200C9A66
00002 #define CONVERSION_H_62B23520_7C8E_11DE_8A39_0800200C9A66
00003 
00004 #if !defined(__GNUC__) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4) // GCC supports "pragma once" correctly since 3.4
00005 #pragma once
00006 #endif
00007 
00008 
00009 #include "yaml-cpp/null.h"
00010 #include "yaml-cpp/traits.h"
00011 #include <string>
00012 #include <sstream>
00013 
00014 namespace YAML
00015 {
00016         inline bool Convert(const std::string& input, std::string& output) {
00017                 output = input;
00018                 return true;
00019         }
00020         
00021         YAML_CPP_API bool Convert(const std::string& input, bool& output);
00022         YAML_CPP_API bool Convert(const std::string& input, _Null& output);
00023         
00024         template <typename T> 
00025         inline bool Convert(const std::string& input, T& output, typename enable_if<is_numeric<T> >::type * = 0) {
00026                 std::stringstream stream(input);
00027                 stream.unsetf(std::ios::dec);
00028                 stream >> output;
00029                 return !!stream;
00030         }
00031 }
00032 
00033 #endif // CONVERSION_H_62B23520_7C8E_11DE_8A39_0800200C9A66
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines