<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>GNU Radio 3.2.2 C++ API: gr_prefs Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.2 --> <div class="contents"> <h1>gr_prefs Class Reference<br/> <small> [<a class="el" href="group__misc.html">Miscellaneous</a>]</small> </h1><!-- doxytag: class="gr_prefs" --> <p>Base class for representing user preferences a la windows INI files.The real implementation is in Python, and is accessable from C++ via the magic of SWIG directors. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="gr__prefs_8h_source.html">gr_prefs.h</a>></code></p> <p><a href="classgr__prefs-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__prefs.html#adcbd242770b0065990db3278f87504aa">~gr_prefs</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="gc__types_8h.html#a0f2b5d454b7e4dda3861032cfce91085">bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__prefs.html#a14ffae7b12913c6c56266e78ef382f32">has_section</a> (const std::string section)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Does <code>section</code> exist? <a href="#a14ffae7b12913c6c56266e78ef382f32"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="gc__types_8h.html#a0f2b5d454b7e4dda3861032cfce91085">bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__prefs.html#a26c69f92423efc17b11240d3b530a080">has_option</a> (const std::string section, const std::string option)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Does <code>option</code> exist? <a href="#a26c69f92423efc17b11240d3b530a080"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual const std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__prefs.html#a43428deda7d302e1c2928d6e78ff5e64">get_string</a> (const std::string section, const std::string option, const std::string default_val)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">If option exists return associated value; else default_val. <a href="#a43428deda7d302e1c2928d6e78ff5e64"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="gc__types_8h.html#a0f2b5d454b7e4dda3861032cfce91085">bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__prefs.html#afd7d816844a2d057d673025802eccecb">get_bool</a> (const std::string section, const std::string option, <a class="el" href="gc__types_8h.html#a0f2b5d454b7e4dda3861032cfce91085">bool</a> default_val)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">If option exists and value can be converted to bool, return it; else default_val. <a href="#afd7d816844a2d057d673025802eccecb"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual long </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__prefs.html#adeee54d39d6c5511271996ff67bcdd9b">get_long</a> (const std::string section, const std::string option, long default_val)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">If option exists and value can be converted to long, return it; else default_val. <a href="#adeee54d39d6c5511271996ff67bcdd9b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual double </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__prefs.html#a30f7c46d3aaea5ce65e97ff1ecb9d7d2">get_double</a> (const std::string section, const std::string option, double default_val)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">If option exists and value can be converted to double, return it; else default_val. <a href="#a30f7c46d3aaea5ce65e97ff1ecb9d7d2"></a><br/></td></tr> <tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classgr__prefs.html">gr_prefs</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__prefs.html#a22198ff16aadb4b26020ff04233f03c3">singleton</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgr__prefs.html#a30685d7214f70df540bc59b6a38a5df0">set_singleton</a> (<a class="el" href="classgr__prefs.html">gr_prefs</a> *p)</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Base class for representing user preferences a la windows INI files.</p> <p>The real implementation is in Python, and is accessable from C++ via the magic of SWIG directors. </p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="adcbd242770b0065990db3278f87504aa"></a><!-- doxytag: member="gr_prefs::~gr_prefs" ref="adcbd242770b0065990db3278f87504aa" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual gr_prefs::~gr_prefs </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="afd7d816844a2d057d673025802eccecb"></a><!-- doxytag: member="gr_prefs::get_bool" ref="afd7d816844a2d057d673025802eccecb" args="(const std::string section, const std::string option, bool default_val)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="gc__types_8h.html#a0f2b5d454b7e4dda3861032cfce91085">bool</a> gr_prefs::get_bool </td> <td>(</td> <td class="paramtype">const std::string </td> <td class="paramname"> <em>section</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string </td> <td class="paramname"> <em>option</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="gc__types_8h.html#a0f2b5d454b7e4dda3861032cfce91085">bool</a> </td> <td class="paramname"> <em>default_val</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>If option exists and value can be converted to bool, return it; else default_val. </p> </div> </div> <a class="anchor" id="a30f7c46d3aaea5ce65e97ff1ecb9d7d2"></a><!-- doxytag: member="gr_prefs::get_double" ref="a30f7c46d3aaea5ce65e97ff1ecb9d7d2" args="(const std::string section, const std::string option, double default_val)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual double gr_prefs::get_double </td> <td>(</td> <td class="paramtype">const std::string </td> <td class="paramname"> <em>section</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string </td> <td class="paramname"> <em>option</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>default_val</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>If option exists and value can be converted to double, return it; else default_val. </p> </div> </div> <a class="anchor" id="adeee54d39d6c5511271996ff67bcdd9b"></a><!-- doxytag: member="gr_prefs::get_long" ref="adeee54d39d6c5511271996ff67bcdd9b" args="(const std::string section, const std::string option, long default_val)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual long gr_prefs::get_long </td> <td>(</td> <td class="paramtype">const std::string </td> <td class="paramname"> <em>section</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string </td> <td class="paramname"> <em>option</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">long </td> <td class="paramname"> <em>default_val</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>If option exists and value can be converted to long, return it; else default_val. </p> </div> </div> <a class="anchor" id="a43428deda7d302e1c2928d6e78ff5e64"></a><!-- doxytag: member="gr_prefs::get_string" ref="a43428deda7d302e1c2928d6e78ff5e64" args="(const std::string section, const std::string option, const std::string default_val)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual const std::string gr_prefs::get_string </td> <td>(</td> <td class="paramtype">const std::string </td> <td class="paramname"> <em>section</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string </td> <td class="paramname"> <em>option</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string </td> <td class="paramname"> <em>default_val</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>If option exists return associated value; else default_val. </p> </div> </div> <a class="anchor" id="a26c69f92423efc17b11240d3b530a080"></a><!-- doxytag: member="gr_prefs::has_option" ref="a26c69f92423efc17b11240d3b530a080" args="(const std::string section, const std::string option)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="gc__types_8h.html#a0f2b5d454b7e4dda3861032cfce91085">bool</a> gr_prefs::has_option </td> <td>(</td> <td class="paramtype">const std::string </td> <td class="paramname"> <em>section</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string </td> <td class="paramname"> <em>option</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Does <code>option</code> exist? </p> </div> </div> <a class="anchor" id="a14ffae7b12913c6c56266e78ef382f32"></a><!-- doxytag: member="gr_prefs::has_section" ref="a14ffae7b12913c6c56266e78ef382f32" args="(const std::string section)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="gc__types_8h.html#a0f2b5d454b7e4dda3861032cfce91085">bool</a> gr_prefs::has_section </td> <td>(</td> <td class="paramtype">const std::string </td> <td class="paramname"> <em>section</em></td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Does <code>section</code> exist? </p> </div> </div> <a class="anchor" id="a30685d7214f70df540bc59b6a38a5df0"></a><!-- doxytag: member="gr_prefs::set_singleton" ref="a30685d7214f70df540bc59b6a38a5df0" args="(gr_prefs *p)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static void gr_prefs::set_singleton </td> <td>(</td> <td class="paramtype"><a class="el" href="classgr__prefs.html">gr_prefs</a> * </td> <td class="paramname"> <em>p</em></td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <a class="anchor" id="a22198ff16aadb4b26020ff04233f03c3"></a><!-- doxytag: member="gr_prefs::singleton" ref="a22198ff16aadb4b26020ff04233f03c3" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classgr__prefs.html">gr_prefs</a>* gr_prefs::singleton </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="gr__prefs_8h_source.html">gr_prefs.h</a></li> </ul> </div> <hr size="1"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> </body> </html>