rohdeschwarz  0.2.0
TCPIP socket library for Rohde & Schwarz instrument control
Namespaces | Typedefs | Functions
rohdeschwarz Namespace Reference

Namespaces

 busses
 
 instruments
 
 scpi
 

Typedefs

using Socket = busses::socket::Socket
 
using Visa = busses::visa::Visa
 
using Instrument = instruments::Instrument using Vna=instruments::vna::Vna
 

Functions

std::string leftTrim (std::string text)
 Trims whitespace from left (beginning) of string. More...
 
std::string rightTrim (std::string text)
 Trims whitespace from right (end) of string. More...
 
std::string trim (const std::string &text)
 Trims whitespace beginning and end of string. More...
 
bool isLeftQuote (const char *text)
 Checks for a quote at the beginning of the string. More...
 
bool isLeftQuote (const std::string &text)
 Checks for a quote at the beginning of the string. More...
 
bool isRightQuote (const char *text)
 Checks for a quote at the end of the string. More...
 
bool isRightQuote (const std::string &text)
 Checks for a quote at the end of the string. More...
 
bool isQuoted (const char *text)
 Checks for quotes at the beginning and end of the string. More...
 
bool isQuoted (const std::string &text)
 Checks for quotes at the beginning and end of the string. More...
 
std::string quote (const char *text, char quote_character='\'')
 Surrounds string in quotes. More...
 
std::string quote (const std::string &text, char quote_character='\'')
 Surrounds string in quotes. More...
 
std::string unquote (const char *text)
 Removes quotes from beginning and end of string. More...
 
std::string unquote (const std::string &text)
 Removes quotes from beginning and end of string. More...
 
std::vector< std::string > split (const char *csvList, const char separator=',')
 Splits string on separator. More...
 
std::vector< std::string > split (const std::string &csvList, const char separator=',')
 Splits string on separator. More...
 
template<class OutputType >
OutputType to_value (std::string input)
 
template<>
int to_value (std::string input)
 
template<class out_type , class in_type = unsigned char>
std::vector< out_type > to_vector (in_type *data, std::size_t data_size)
 Converts a vector of a primitive type to a vector of a different primitive type. More...
 
template<class in_type = unsigned char>
std::vector< std::complex< double > > to_vector_complex_double (in_type *data, std::size_t data_size)
 Converts a vector of a primitive type to a vector of complex<double> More...
 

Typedef Documentation

◆ Instrument

Definition at line 14 of file instruments.hpp.

◆ Socket

Definition at line 15 of file busses.hpp.

◆ Visa

Definition at line 16 of file busses.hpp.

Function Documentation

◆ isLeftQuote() [1/2]

bool rohdeschwarz::isLeftQuote ( const char *  text)

Checks for a quote at the beginning of the string.

Quotes can be single or double.

Parameters
[in]textC style string

Definition at line 62 of file helpers.cpp.

◆ isLeftQuote() [2/2]

bool rohdeschwarz::isLeftQuote ( const std::string &  text)

Checks for a quote at the beginning of the string.

Quotes can be single or double.

Parameters
[in]textC++ style string

Definition at line 69 of file helpers.cpp.

◆ isQuoted() [1/2]

bool rohdeschwarz::isQuoted ( const char *  text)

Checks for quotes at the beginning and end of the string.

Quotes can be single or double.

Parameters
[in]textC style string

Definition at line 93 of file helpers.cpp.

◆ isQuoted() [2/2]

bool rohdeschwarz::isQuoted ( const std::string &  text)

Checks for quotes at the beginning and end of the string.

Quotes can be single or double.

Parameters
[in]textC++ style string

Definition at line 100 of file helpers.cpp.

◆ isRightQuote() [1/2]

bool rohdeschwarz::isRightQuote ( const char *  text)

Checks for a quote at the end of the string.

Quotes can be single or double.

Parameters
[in]textC style string

Definition at line 80 of file helpers.cpp.

◆ isRightQuote() [2/2]

bool rohdeschwarz::isRightQuote ( const std::string &  text)

Checks for a quote at the end of the string.

Quotes can be single or double.

Parameters
[in]textC++ style string

Definition at line 87 of file helpers.cpp.

◆ leftTrim()

std::string rohdeschwarz::leftTrim ( std::string  text)

Trims whitespace from left (beginning) of string.

Definition at line 39 of file helpers.cpp.

◆ quote() [1/2]

std::string rohdeschwarz::quote ( const char *  text,
char  quote_character = '\'' 
)

Surrounds string in quotes.

Parameters
[in]textC style string to quote
[in]quote_characterQuote to use; defaults to single quote

Definition at line 106 of file helpers.cpp.

◆ quote() [2/2]

std::string rohdeschwarz::quote ( const std::string &  text,
char  quote_character = '\'' 
)

Surrounds string in quotes.

Parameters
[in]textC++ style string to quote
[in]quote_characterQuote to use; defaults to single quote

Definition at line 113 of file helpers.cpp.

◆ rightTrim()

std::string rohdeschwarz::rightTrim ( std::string  text)

Trims whitespace from right (end) of string.

Definition at line 47 of file helpers.cpp.

◆ split() [1/2]

std::vector< std::string > rohdeschwarz::split ( const char *  csvList,
const char  separator = ',' 
)

Splits string on separator.

Parameters
[in]csvListC style string to split
[in]separatorCharacter to separate on; defaults to comma ,

Definition at line 136 of file helpers.cpp.

◆ split() [2/2]

std::vector< std::string > rohdeschwarz::split ( const std::string &  csvList,
const char  separator = ',' 
)

Splits string on separator.

Parameters
[in]csvListC++ style string to split
[in]separatorCharacter to separate on; defaults to comma ,

Definition at line 143 of file helpers.cpp.

◆ to_value() [1/2]

template<class OutputType >
OutputType rohdeschwarz::to_value ( std::string  input)

◆ to_value() [2/2]

template<>
std::string rohdeschwarz::to_value ( std::string  input)

Definition at line 7 of file to_value.cpp.

◆ to_vector()

template<class out_type , class in_type = unsigned char>
std::vector<out_type> rohdeschwarz::to_vector ( in_type *  data,
std::size_t  data_size 
)

Converts a vector of a primitive type to a vector of a different primitive type.

Definition at line 27 of file to_vector.hpp.

◆ to_vector_complex_double()

template<class in_type = unsigned char>
std::vector<std::complex<double> > rohdeschwarz::to_vector_complex_double ( in_type *  data,
std::size_t  data_size 
)

Converts a vector of a primitive type to a vector of complex<double>

The original vector is assumed to be of the format:

<real1><imag1><real2><imag2>...

Definition at line 51 of file to_vector.hpp.

◆ trim()

std::string rohdeschwarz::trim ( const std::string &  text)

Trims whitespace beginning and end of string.

Definition at line 56 of file helpers.cpp.

◆ unquote() [1/2]

std::string rohdeschwarz::unquote ( const char *  text)

Removes quotes from beginning and end of string.

Parameters
[in]textC style string to unquote

Definition at line 121 of file helpers.cpp.

◆ unquote() [2/2]

std::string rohdeschwarz::unquote ( const std::string &  text)

Removes quotes from beginning and end of string.

Parameters
[in]textC++ style string to unquote

Definition at line 128 of file helpers.cpp.