21#ifndef OSMOSDR_ARG_HELPERS_H
22#define OSMOSDR_ARG_HELPERS_H
28#include <gnuradio/io_signature.h>
30#include <boost/lexical_cast.hpp>
31#include <boost/tokenizer.hpp>
34typedef std::map< std::string, std::string >
dict_t;
35typedef std::pair< std::string, std::string >
pair_t;
43 out += pair.first +
"='" + pair.second +
"'";
50 std::vector< std::string >
result;
52 boost::escaped_list_separator<char>
separator(
"\\",
" ",
"'");
53 typedef boost::tokenizer< boost::escaped_list_separator<char> >
tokenizer_t;
64 std::vector< std::string >
result;
66 boost::escaped_list_separator<char>
separator(
"\\",
",",
"'");
67 typedef boost::tokenizer< boost::escaped_list_separator<char> >
tokenizer_t;
81 if(
pos != std::string::npos)
103 std::string value = pair.second;
104 if (value.length() && value[0] ==
'\'' && value[ value.length() - 1 ] ==
'\'')
105 value = value.substr(1, value.length() - 1);
106 result[ pair.first ] = value;
116 return str.find(
"numchan=") == 0;
128 if (
arg.find(
"numchan=" ) == 0 )
131 max_nchan = boost::lexical_cast<size_t>( pair.second );
158 throw std::runtime_error(
"Wrong device arguments specified. Missing nchan?");
std::vector< std::string > args_to_vector(const std::string &args)
Definition arg_helpers.h:48
std::vector< std::string > params_to_vector(const std::string ¶ms)
Definition arg_helpers.h:62
std::map< std::string, std::string > dict_t
Definition arg_helpers.h:34
dict_t params_to_dict(const std::string ¶ms)
Definition arg_helpers.h:95
std::pair< std::string, std::string > pair_t
Definition arg_helpers.h:35
std::string dict_to_args_string(const dict_t &d)
Definition arg_helpers.h:37
pair_t param_to_pair(const std::string ¶m)
Definition arg_helpers.h:76
gr::io_signature::sptr args_to_io_signature(const std::string &args)
Definition arg_helpers.h:120
Definition hackrf_sink_c.h:37
size_t count
Definition hackrf_sink_c.h:41
Definition arg_helpers.h:113
bool operator()(const std::string &str)
Definition arg_helpers.h:114