rohdeschwarz  0.2.0
TCPIP socket library for Rohde & Schwarz instrument control
to_value.cpp
Go to the documentation of this file.
1 // rohdeschwarz
4 
5 
6 template<>
7 int rohdeschwarz::to_value(std::string input)
8 {
9  return std::stoi( rohdeschwarz::trim(input));
10 }
11 
12 
13 // unsigned int
14 template<>
15 unsigned int rohdeschwarz::to_value(std::string input)
16 {
17  return std::stoul( rohdeschwarz::trim(input));
18 }
19 
20 
21 // double
22 template<>
23 double rohdeschwarz::to_value(std::string input)
24 {
25  return std::stod( rohdeschwarz::trim(input));
26 }
27 
28 
29 // string
30 template<>
31 std::string rohdeschwarz::to_value(std::string input)
32 {
34 }
rohdeschwarz helper function definition
OutputType to_value(std::string input)
std::string unquote(const char *text)
Removes quotes from beginning and end of string.
Definition: helpers.cpp:121
std::string trim(const std::string &text)
Trims whitespace beginning and end of string.
Definition: helpers.cpp:56