rohdeschwarz  0.2.0
TCPIP socket library for Rohde & Schwarz instrument control
bool.cpp
Go to the documentation of this file.
1 
7 // rohdeschwarz
10 
11 
12 std::string rohdeschwarz::scpi::toScpi(bool value)
13 {
14  return value? "1" : "0";
15 }
16 
17 
18 bool rohdeschwarz::scpi::toBool(std::string scpi)
19 {
20  return rohdeschwarz::trim(scpi) == "1";
21 }
rohdeschwarz helper function definition
std::string toScpi(bool value)
Converts C/C++ bool to SCPI bool.
Definition: bool.cpp:12
bool toBool(std::string scpi)
Converts SCPI bool to C/C++ bool.
Definition: bool.cpp:18
std::string trim(const std::string &text)
Trims whitespace beginning and end of string.
Definition: helpers.cpp:56