| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| <meta http-equiv="X-UA-Compatible" content="IE=11"/> |
| <meta name="generator" content="Doxygen 1.9.6"/> |
| <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| <title>Apache Log4cxx: log4cxx::helpers::OptionConverter Class Reference</title> |
| <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="jquery.js"></script> |
| <script type="text/javascript" src="dynsections.js"></script> |
| <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="resize.js"></script> |
| <script type="text/javascript" src="navtreedata.js"></script> |
| <script type="text/javascript" src="navtree.js"></script> |
| <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="search/searchdata.js"></script> |
| <script type="text/javascript" src="search/search.js"></script> |
| <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| <link href="customdoxygen.css" rel="stylesheet" type="text/css"/> |
| </head> |
| <body> |
| <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| <div id="titlearea"> |
| <table cellspacing="0" cellpadding="0"> |
| <tbody> |
| <tr id="projectrow"> |
| <td id="projectalign"> |
| <div id="projectname">Apache Log4cxx<span id="projectnumber"> Version 1.1.0</span> |
| </div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.9.6 --> |
| <script type="text/javascript"> |
| /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ |
| var searchBox = new SearchBox("searchBox", "search/",'.html'); |
| /* @license-end */ |
| </script> |
| <script type="text/javascript" src="menudata.js"></script> |
| <script type="text/javascript" src="menu.js"></script> |
| <script type="text/javascript"> |
| /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ |
| $(function() { |
| initMenu('',true,false,'search.php','Search'); |
| $(document).ready(function() { init_search(); }); |
| }); |
| /* @license-end */ |
| </script> |
| <div id="main-nav"></div> |
| </div><!-- top --> |
| <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| <div id="nav-tree"> |
| <div id="nav-tree-contents"> |
| <div id="nav-sync" class="sync"></div> |
| </div> |
| </div> |
| <div id="splitbar" style="-moz-user-select:none;" |
| class="ui-resizable-handle"> |
| </div> |
| </div> |
| <script type="text/javascript"> |
| /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ |
| $(document).ready(function(){initNavTree('classlog4cxx_1_1helpers_1_1OptionConverter.html',''); initResizable(); }); |
| /* @license-end */ |
| </script> |
| <div id="doc-content"> |
| <!-- window showing the filter options --> |
| <div id="MSearchSelectWindow" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| </div> |
| |
| <!-- iframe showing the search results (closed by default) --> |
| <div id="MSearchResultsWindow"> |
| <div id="MSearchResults"> |
| <div class="SRPage"> |
| <div id="SRIndex"> |
| <div id="SRResults"></div> |
| <div class="SRStatus" id="Loading">Loading...</div> |
| <div class="SRStatus" id="Searching">Searching...</div> |
| <div class="SRStatus" id="NoMatches">No Matches</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| |
| <div class="header"> |
| <div class="summary"> |
| <a href="#pub-static-methods">Static Public Member Functions</a> | |
| <a href="classlog4cxx_1_1helpers_1_1OptionConverter-members.html">List of all members</a> </div> |
| <div class="headertitle"><div class="title">log4cxx::helpers::OptionConverter Class Reference</div></div> |
| </div><!--header--> |
| <div class="contents"> |
| |
| <p>A convenience class to convert property values to specific types. |
| <a href="classlog4cxx_1_1helpers_1_1OptionConverter.html#details">More...</a></p> |
| |
| <p><code>#include <<a class="el" href="optionconverter_8h_source.html">optionconverter.h</a>></code></p> |
| <table class="memberdecls"> |
| <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a> |
| Static Public Member Functions</h2></td></tr> |
| <tr class="memitem:a17aba78459f5de8a8f0c6edb78554869"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1OptionConverter.html#a17aba78459f5de8a8f0c6edb78554869">convertSpecialChars</a> (const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> &s)</td></tr> |
| <tr class="separator:a17aba78459f5de8a8f0c6edb78554869"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a58f581196122598434d43b02c3b5cc16"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1OptionConverter.html#a58f581196122598434d43b02c3b5cc16">toBoolean</a> (const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> &value, bool defaultValue)</td></tr> |
| <tr class="memdesc:a58f581196122598434d43b02c3b5cc16"><td class="mdescLeft"> </td><td class="mdescRight">The boolean equivalent of <code>value</code> if it is not empty, otherwise <code>defaultValue</code>. <br /></td></tr> |
| <tr class="separator:a58f581196122598434d43b02c3b5cc16"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:af0462428ca4c014fab0f81e4da0fe424"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1OptionConverter.html#af0462428ca4c014fab0f81e4da0fe424">toInt</a> (const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> &value, int defaultValue)</td></tr> |
| <tr class="memdesc:af0462428ca4c014fab0f81e4da0fe424"><td class="mdescLeft"> </td><td class="mdescRight">The numeric equivalent of <code>value</code> if it is not empty, otherwise <code>defaultValue</code>. <br /></td></tr> |
| <tr class="separator:af0462428ca4c014fab0f81e4da0fe424"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a1479a7a9835fc631dcfa9187194a8c8d"><td class="memItemLeft" align="right" valign="top">static long </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1OptionConverter.html#a1479a7a9835fc631dcfa9187194a8c8d">toFileSize</a> (const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> &value, long defaultValue)</td></tr> |
| <tr class="memdesc:a1479a7a9835fc631dcfa9187194a8c8d"><td class="mdescLeft"> </td><td class="mdescRight">The numeric equivalent of <code>value</code> if it is not empty, otherwise <code>defaultValue</code>. <br /></td></tr> |
| <tr class="separator:a1479a7a9835fc631dcfa9187194a8c8d"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a283d02a868da5f3d196d80872f551271"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespacelog4cxx.html#abab74d1809c0c810f3f7eae2c3fa511e">LevelPtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1OptionConverter.html#a283d02a868da5f3d196d80872f551271">toLevel</a> (const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> &value, const <a class="el" href="namespacelog4cxx.html#abab74d1809c0c810f3f7eae2c3fa511e">LevelPtr</a> &defaultValue)</td></tr> |
| <tr class="memdesc:a283d02a868da5f3d196d80872f551271"><td class="mdescLeft"> </td><td class="mdescRight">The <a class="el" href="classlog4cxx_1_1Level.html" title="Defines the minimum set of levels recognized by the system, that is OFF, FATAL, ERROR,...">Level</a> indicated by <code>value</code> if recognised otherwise <code>defaultValue</code>. <br /></td></tr> |
| <tr class="separator:a283d02a868da5f3d196d80872f551271"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a5f6f13492e81a9c6b38ddfe112102cce"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1OptionConverter.html#a5f6f13492e81a9c6b38ddfe112102cce">findAndSubst</a> (const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> &key, <a class="el" href="classlog4cxx_1_1helpers_1_1Properties.html">Properties</a> &props)</td></tr> |
| <tr class="memdesc:a5f6f13492e81a9c6b38ddfe112102cce"><td class="mdescLeft"> </td><td class="mdescRight">Find the value corresponding to <code>key</code> in <code>props</code>. <br /></td></tr> |
| <tr class="separator:a5f6f13492e81a9c6b38ddfe112102cce"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:ab8106a35fe8f61b58f4a88ce19707d83"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1OptionConverter.html#ab8106a35fe8f61b58f4a88ce19707d83">substVars</a> (const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> &val, <a class="el" href="classlog4cxx_1_1helpers_1_1Properties.html">Properties</a> &props)</td></tr> |
| <tr class="memdesc:ab8106a35fe8f61b58f4a88ce19707d83"><td class="mdescLeft"> </td><td class="mdescRight">Perform variable substitution in string <code>val</code> from the values of keys found in the system propeties. <br /></td></tr> |
| <tr class="separator:ab8106a35fe8f61b58f4a88ce19707d83"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a0be0a85c51d1301bd0a4bfb46b7826ec"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1OptionConverter.html#a0be0a85c51d1301bd0a4bfb46b7826ec">getSystemProperty</a> (const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> &key, const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> &def)</td></tr> |
| <tr class="separator:a0be0a85c51d1301bd0a4bfb46b7826ec"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:aea6ca9e53725a132bae3015b5e473b36"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespacelog4cxx_1_1helpers.html#afd85348ac51f52a1e065d249c7b1e3a7">ObjectPtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1OptionConverter.html#aea6ca9e53725a132bae3015b5e473b36">instantiateByClassName</a> (const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> &className, const <a class="el" href="classlog4cxx_1_1helpers_1_1Class.html">Class</a> &superClass, const <a class="el" href="namespacelog4cxx_1_1helpers.html#afd85348ac51f52a1e065d249c7b1e3a7">ObjectPtr</a> &defaultValue)</td></tr> |
| <tr class="memdesc:aea6ca9e53725a132bae3015b5e473b36"><td class="mdescLeft"> </td><td class="mdescRight">Instantiate an object given a class name. <br /></td></tr> |
| <tr class="separator:aea6ca9e53725a132bae3015b5e473b36"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a21ac93452932ab2618393aeb2d036534"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespacelog4cxx_1_1helpers.html#afd85348ac51f52a1e065d249c7b1e3a7">ObjectPtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1OptionConverter.html#a21ac93452932ab2618393aeb2d036534">instantiateByKey</a> (<a class="el" href="classlog4cxx_1_1helpers_1_1Properties.html">Properties</a> &props, const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> &key, const <a class="el" href="classlog4cxx_1_1helpers_1_1Class.html">Class</a> &superClass, const <a class="el" href="namespacelog4cxx_1_1helpers.html#afd85348ac51f52a1e065d249c7b1e3a7">ObjectPtr</a> &defaultValue)</td></tr> |
| <tr class="separator:a21ac93452932ab2618393aeb2d036534"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:ad263683222174797d031dfe447fae957"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1OptionConverter.html#ad263683222174797d031dfe447fae957">selectAndConfigure</a> (const <a class="el" href="classlog4cxx_1_1File.html">File</a> &configFileName, const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> &clazz, <a class="el" href="namespacelog4cxx_1_1spi.html#a38a7dc69832e0647515f643f01be6fa5">spi::LoggerRepositoryPtr</a> hierarchy, int delay=0)</td></tr> |
| <tr class="memdesc:ad263683222174797d031dfe447fae957"><td class="mdescLeft"> </td><td class="mdescRight">Configure <a class="el" href="namespacelog4cxx.html">log4cxx</a> given a configFileName. <br /></td></tr> |
| <tr class="separator:ad263683222174797d031dfe447fae957"><td class="memSeparator" colspan="2"> </td></tr> |
| </table> |
| <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| <div class="textblock"><p>A convenience class to convert property values to specific types. </p> |
| </div><h2 class="groupheader">Member Function Documentation</h2> |
| <a id="a17aba78459f5de8a8f0c6edb78554869" name="a17aba78459f5de8a8f0c6edb78554869"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a17aba78459f5de8a8f0c6edb78554869">◆ </a></span>convertSpecialChars()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> log4cxx::helpers::OptionConverter::convertSpecialChars </td> |
| <td>(</td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> & </td> |
| <td class="paramname"><em>s</em></td><td>)</td> |
| <td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| </div> |
| </div> |
| <a id="a5f6f13492e81a9c6b38ddfe112102cce" name="a5f6f13492e81a9c6b38ddfe112102cce"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a5f6f13492e81a9c6b38ddfe112102cce">◆ </a></span>findAndSubst()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> log4cxx::helpers::OptionConverter::findAndSubst </td> |
| <td>(</td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> & </td> |
| <td class="paramname"><em>key</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classlog4cxx_1_1helpers_1_1Properties.html">Properties</a> & </td> |
| <td class="paramname"><em>props</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>Find the value corresponding to <code>key</code> in <code>props</code>. </p> |
| <p>Then perform variable substitution on the found value. </p> |
| |
| </div> |
| </div> |
| <a id="a0be0a85c51d1301bd0a4bfb46b7826ec" name="a0be0a85c51d1301bd0a4bfb46b7826ec"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a0be0a85c51d1301bd0a4bfb46b7826ec">◆ </a></span>getSystemProperty()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> log4cxx::helpers::OptionConverter::getSystemProperty </td> |
| <td>(</td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> & </td> |
| <td class="paramname"><em>key</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> & </td> |
| <td class="paramname"><em>def</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| <pre class="fragment">Gets the specified system property. |
| </pre> <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">key</td><td>The key to search for. </td></tr> |
| <tr><td class="paramname">def</td><td>The default value to return. </td></tr> |
| </table> |
| </dd> |
| </dl> |
| <dl class="section return"><dt>Returns</dt><dd>the string value of the system property, or the default value if there is no property with that key. </dd></dl> |
| |
| </div> |
| </div> |
| <a id="aea6ca9e53725a132bae3015b5e473b36" name="aea6ca9e53725a132bae3015b5e473b36"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#aea6ca9e53725a132bae3015b5e473b36">◆ </a></span>instantiateByClassName()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static <a class="el" href="namespacelog4cxx_1_1helpers.html#afd85348ac51f52a1e065d249c7b1e3a7">ObjectPtr</a> log4cxx::helpers::OptionConverter::instantiateByClassName </td> |
| <td>(</td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> & </td> |
| <td class="paramname"><em>className</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">const <a class="el" href="classlog4cxx_1_1helpers_1_1Class.html">Class</a> & </td> |
| <td class="paramname"><em>superClass</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx_1_1helpers.html#afd85348ac51f52a1e065d249c7b1e3a7">ObjectPtr</a> & </td> |
| <td class="paramname"><em>defaultValue</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>Instantiate an object given a class name. </p> |
| <p>Check that the <code>className</code> is a subclass of <code>superClass</code>. If that test fails or the object could not be instantiated, then <code>defaultValue</code> is returned.</p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">className</td><td>The fully qualified class name of the object to instantiate. </td></tr> |
| <tr><td class="paramname">superClass</td><td>The class to which the new object should belong. </td></tr> |
| <tr><td class="paramname">defaultValue</td><td>The object to return in case of non-fulfillment </td></tr> |
| </table> |
| </dd> |
| </dl> |
| |
| </div> |
| </div> |
| <a id="a21ac93452932ab2618393aeb2d036534" name="a21ac93452932ab2618393aeb2d036534"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a21ac93452932ab2618393aeb2d036534">◆ </a></span>instantiateByKey()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static <a class="el" href="namespacelog4cxx_1_1helpers.html#afd85348ac51f52a1e065d249c7b1e3a7">ObjectPtr</a> log4cxx::helpers::OptionConverter::instantiateByKey </td> |
| <td>(</td> |
| <td class="paramtype"><a class="el" href="classlog4cxx_1_1helpers_1_1Properties.html">Properties</a> & </td> |
| <td class="paramname"><em>props</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> & </td> |
| <td class="paramname"><em>key</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">const <a class="el" href="classlog4cxx_1_1helpers_1_1Class.html">Class</a> & </td> |
| <td class="paramname"><em>superClass</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx_1_1helpers.html#afd85348ac51f52a1e065d249c7b1e3a7">ObjectPtr</a> & </td> |
| <td class="paramname"><em>defaultValue</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| </div> |
| </div> |
| <a id="ad263683222174797d031dfe447fae957" name="ad263683222174797d031dfe447fae957"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#ad263683222174797d031dfe447fae957">◆ </a></span>selectAndConfigure()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static void log4cxx::helpers::OptionConverter::selectAndConfigure </td> |
| <td>(</td> |
| <td class="paramtype">const <a class="el" href="classlog4cxx_1_1File.html">File</a> & </td> |
| <td class="paramname"><em>configFileName</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> & </td> |
| <td class="paramname"><em>clazz</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="namespacelog4cxx_1_1spi.html#a38a7dc69832e0647515f643f01be6fa5">spi::LoggerRepositoryPtr</a> </td> |
| <td class="paramname"><em>hierarchy</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>delay</em> = <code>0</code> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>Configure <a class="el" href="namespacelog4cxx.html">log4cxx</a> given a configFileName. </p> |
| <p>The configFileName must point to a file which will be interpreted by a new instance of a <a class="el" href="namespacelog4cxx.html">log4cxx</a> configurator.</p> |
| <p>All configurations steps are taken on the <code>hierarchy</code> passed as a parameter.</p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">configFileName</td><td>The location of the configuration file. </td></tr> |
| <tr><td class="paramname">clazz</td><td>The classname, of the <a class="el" href="namespacelog4cxx.html">log4cxx</a> configurator which will parse the file <code>configFileName</code>. This must be a subclass of Configurator, or null. If this value is null then a default configurator of <a class="el" href="classlog4cxx_1_1PropertyConfigurator.html" title="Allows the configuration of log4cxx from an external file.">PropertyConfigurator</a> is used, unless the filename pointed to by <code>configFileName</code> ends in '.xml', in which case DOMConfigurator is used. </td></tr> |
| <tr><td class="paramname">hierarchy</td><td>The <a class="el" href="classlog4cxx_1_1Hierarchy.html" title="This class is specialized in retrieving loggers by name and also maintaining the logger hierarchy.">Hierarchy</a> to act on. </td></tr> |
| <tr><td class="paramname">delay</td><td>If greater than zero, the milliseconds to sleep between checking if <code>configFileName</code> has been modified and needs to be reloaded. </td></tr> |
| </table> |
| </dd> |
| </dl> |
| |
| </div> |
| </div> |
| <a id="ab8106a35fe8f61b58f4a88ce19707d83" name="ab8106a35fe8f61b58f4a88ce19707d83"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#ab8106a35fe8f61b58f4a88ce19707d83">◆ </a></span>substVars()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> log4cxx::helpers::OptionConverter::substVars </td> |
| <td>(</td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> & </td> |
| <td class="paramname"><em>val</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classlog4cxx_1_1helpers_1_1Properties.html">Properties</a> & </td> |
| <td class="paramname"><em>props</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>Perform variable substitution in string <code>val</code> from the values of keys found in the system propeties. </p> |
| <p>The variable substitution delimeters are <b>${</b> and <b>}</b>.</p> |
| <p>For example, if the <a class="el" href="classlog4cxx_1_1helpers_1_1System.html" title="The System class contains several useful class fields and methods.">System</a> properties contains "key=value", then the call </p><div class="fragment"><div class="line"><span class="keyword">auto</span> s = <a class="code hl_class" href="classlog4cxx_1_1helpers_1_1OptionConverter.html">OptionConverter</a>.substituteVars(<span class="stringliteral">"Value of key is ${key}."</span>);</div> |
| <div class="ttc" id="aclasslog4cxx_1_1helpers_1_1OptionConverter_html"><div class="ttname"><a href="classlog4cxx_1_1helpers_1_1OptionConverter.html">log4cxx::helpers::OptionConverter</a></div><div class="ttdoc">A convenience class to convert property values to specific types.</div><div class="ttdef"><b>Definition:</b> optionconverter.h:47</div></div> |
| </div><!-- fragment --><p>will set the variable <code>s</code> to "Value of key is value.".</p> |
| <p>If no value could be found for the specified key, then the <code>props</code> parameter is searched, if the value could not be found there, then substitution defaults to the empty string.</p> |
| <p>For example, if system propeties contains no value for the key "inexistentKey", then the call</p> |
| <div class="fragment"><div class="line"><span class="keyword">auto</span> s = <a class="code hl_class" href="classlog4cxx_1_1helpers_1_1OptionConverter.html">OptionConverter</a>.subsVars(<span class="stringliteral">"Value of inexistentKey is [${inexistentKey}]"</span>);</div> |
| </div><!-- fragment --><p> will set <code>s</code> to "Value of inexistentKey is []"</p> |
| <p>An <a class="el" href="classlog4cxx_1_1helpers_1_1IllegalArgumentException.html" title="Thrown to indicate that a method has been passed an illegal or inappropriate argument.">IllegalArgumentException</a> is thrown if <code>val</code> contains a start delimeter "${" which is not balanced by a stop delimeter "}". </p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">val</td><td>The string on which variable substitution is performed. </td></tr> |
| <tr><td class="paramname">props</td><td>The properties from which variable substitution is performed. </td></tr> |
| </table> |
| </dd> |
| </dl> |
| <dl class="exception"><dt>Exceptions</dt><dd> |
| <table class="exception"> |
| <tr><td class="paramname"><a class="el" href="classlog4cxx_1_1helpers_1_1IllegalArgumentException.html" title="Thrown to indicate that a method has been passed an illegal or inappropriate argument.">IllegalArgumentException</a></td><td>if <code>val</code> is malformed. </td></tr> |
| </table> |
| </dd> |
| </dl> |
| |
| </div> |
| </div> |
| <a id="a58f581196122598434d43b02c3b5cc16" name="a58f581196122598434d43b02c3b5cc16"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a58f581196122598434d43b02c3b5cc16">◆ </a></span>toBoolean()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static bool log4cxx::helpers::OptionConverter::toBoolean </td> |
| <td>(</td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> & </td> |
| <td class="paramname"><em>value</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">bool </td> |
| <td class="paramname"><em>defaultValue</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>The boolean equivalent of <code>value</code> if it is not empty, otherwise <code>defaultValue</code>. </p> |
| <p>If <code>value</code> is "true", then <code>true</code> is returned. If <code>value</code> is "false", then <code>true</code> is returned. Case of <code>value</code> is unimportant.</p> |
| <dl class="section return"><dt>Returns</dt><dd><code>defaultValue</code> if <code>value</code> is not "true" or "false", otherwise the boolean equivalent of <code>value</code> </dd></dl> |
| |
| </div> |
| </div> |
| <a id="a1479a7a9835fc631dcfa9187194a8c8d" name="a1479a7a9835fc631dcfa9187194a8c8d"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a1479a7a9835fc631dcfa9187194a8c8d">◆ </a></span>toFileSize()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static long log4cxx::helpers::OptionConverter::toFileSize </td> |
| <td>(</td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> & </td> |
| <td class="paramname"><em>value</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">long </td> |
| <td class="paramname"><em>defaultValue</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>The numeric equivalent of <code>value</code> if it is not empty, otherwise <code>defaultValue</code>. </p> |
| <p>A suffix "KB", "MB" or "GB" after an integer value converts the provided number respectively to kilobytes, megabytes and gigabytes. For example, the value "10KB" will be interpreted as 10240. </p> |
| |
| </div> |
| </div> |
| <a id="af0462428ca4c014fab0f81e4da0fe424" name="af0462428ca4c014fab0f81e4da0fe424"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#af0462428ca4c014fab0f81e4da0fe424">◆ </a></span>toInt()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static int log4cxx::helpers::OptionConverter::toInt </td> |
| <td>(</td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> & </td> |
| <td class="paramname"><em>value</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>defaultValue</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>The numeric equivalent of <code>value</code> if it is not empty, otherwise <code>defaultValue</code>. </p> |
| <dl class="section return"><dt>Returns</dt><dd>Zero if <code>value</code> does not begin with a valid integral number otherwise the numeric equivalent of <code>value</code> </dd></dl> |
| |
| </div> |
| </div> |
| <a id="a283d02a868da5f3d196d80872f551271" name="a283d02a868da5f3d196d80872f551271"></a> |
| <h2 class="memtitle"><span class="permalink"><a href="#a283d02a868da5f3d196d80872f551271">◆ </a></span>toLevel()</h2> |
| |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static <a class="el" href="namespacelog4cxx.html#abab74d1809c0c810f3f7eae2c3fa511e">LevelPtr</a> log4cxx::helpers::OptionConverter::toLevel </td> |
| <td>(</td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> & </td> |
| <td class="paramname"><em>value</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">const <a class="el" href="namespacelog4cxx.html#abab74d1809c0c810f3f7eae2c3fa511e">LevelPtr</a> & </td> |
| <td class="paramname"><em>defaultValue</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>The <a class="el" href="classlog4cxx_1_1Level.html" title="Defines the minimum set of levels recognized by the system, that is OFF, FATAL, ERROR,...">Level</a> indicated by <code>value</code> if recognised otherwise <code>defaultValue</code>. </p> |
| <p>To be recognised, <code>value</code> must be one of "Trace", "Debug", "Info", "Warn", "Error", "Fatal", "Off", "All" or a custom level in which case it is of the form <code>{levelName}#{registeredClassName}</code>.</p> |
| <p>Case of <code>value</code> is unimportant. </p> |
| |
| </div> |
| </div> |
| <hr/>The documentation for this class was generated from the following file:<ul> |
| <li><a class="el" href="optionconverter_8h_source.html">optionconverter.h</a></li> |
| </ul> |
| </div><!-- contents --> |
| </div><!-- doc-content --> |
| <!-- HTML footer for doxygen 1.8.13--> |
| <!-- start footer part --> |
| <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| <ul> |
| <li class="navelem"><a class="el" href="namespacelog4cxx.html">log4cxx</a></li><li class="navelem"><a class="el" href="namespacelog4cxx_1_1helpers.html">helpers</a></li><li class="navelem"><a class="el" href="classlog4cxx_1_1helpers_1_1OptionConverter.html">OptionConverter</a></li> |
| <li class="footer">Generated by |
| <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="https://www.doxygen.nl/images/doxygen.png" alt="Doxygen"/></a> 1.9.6 on Tue Jul 11 2023 </li> |
| <li class="center"> |
| Copyright © 2003-2023 <a href="https://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved. <a href="https://privacy.apache.org/policies/privacy-policy-public.html">Privacy Policy</a><br/> |
| Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, and the Apache Logging project logo are trademarks of The Apache Software Foundation.<br/> |
| </li> |
| </ul> |
| </div> |
| </body> |
| </html> |