blob: 8c694550fe95963bc4ce7752740e7e453db773f4 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Apache log4cxx: OptionConverter Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.6 -->
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li id="current"><a href="classes.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul></div>
<div class="tabs">
<ul>
<li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul></div>
<div class="nav">
<a class="el" href="namespacelog4cxx.html">log4cxx</a>::<a class="el" href="namespacelog4cxx_1_1helpers.html">helpers</a>::<a class="el" href="classlog4cxx_1_1helpers_1_1_option_converter.html">OptionConverter</a></div>
<h1>OptionConverter Class Reference</h1><!-- doxytag: class="log4cxx::helpers::OptionConverter" --><a href="classlog4cxx_1_1helpers_1_1_option_converter-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
A convenience class to convert property values to specific types.
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_option_converter.html#84695a8b2e45b1ab42caef5dc65534eb">convertSpecialChars</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;s)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_option_converter.html#6ea7dcdf1610e5d7e7f3d6004db6ef3c">toBoolean</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;value, bool dEfault)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">If <code>value</code> is "true", then <code>true</code> is returned. <a href="#6ea7dcdf1610e5d7e7f3d6004db6ef3c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_option_converter.html#c849988e20a74924dae77bc1a6e6e4fb">toInt</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;value, int dEfault)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_option_converter.html#f0b5a6bd84b27ef758e7d6d74b362ebf">toFileSize</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;value, long dEfault)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LevelPtr</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_option_converter.html#53e994f695af6def12f5caa8b0f2f5de">toLevel</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;value, const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LevelPtr</a> &amp;defaultValue)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_option_converter.html#06323a5e7986b04e0799254c8e313b82">findAndSubst</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;key, <a class="el" href="classlog4cxx_1_1helpers_1_1_properties.html">Properties</a> &amp;props)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Find the value corresponding to <code>key</code> in <code>props</code>. <a href="#06323a5e7986b04e0799254c8e313b82"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_option_converter.html#45b8aeeafeace89385672ffab025e9d1">substVars</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;val, <a class="el" href="classlog4cxx_1_1helpers_1_1_properties.html">Properties</a> &amp;props)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Perform variable substitution in string <code>val</code> from the values of keys found in the system propeties. <a href="#45b8aeeafeace89385672ffab025e9d1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_option_converter.html#e6cbcb2248b2c331c8a6fe1c057f676c">getSystemProperty</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;key, const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;def)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gets the specified system property. <a href="#e6cbcb2248b2c331c8a6fe1c057f676c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">ObjectPtr</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_option_converter.html#2bf6497289e61895072587bd71985ea6">instantiateByClassName</a> (const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;className, const <a class="el" href="classlog4cxx_1_1helpers_1_1_class.html">Class</a> &amp;superClass, const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">ObjectPtr</a> &amp;defaultValue)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Instantiate an object given a class name. <a href="#2bf6497289e61895072587bd71985ea6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">ObjectPtr</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_option_converter.html#95d3941c5882b39163dc3f229a2c0317">instantiateByKey</a> (<a class="el" href="classlog4cxx_1_1helpers_1_1_properties.html">Properties</a> &amp;props, const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;key, const <a class="el" href="classlog4cxx_1_1helpers_1_1_class.html">Class</a> &amp;superClass, const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">ObjectPtr</a> &amp;defaultValue)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cxx_1_1helpers_1_1_option_converter.html#03defb93e089056749f0e5523ec6315f">selectAndConfigure</a> (const <a class="el" href="classlog4cxx_1_1_file.html">File</a> &amp;configFileName, const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;clazz, <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">spi::LoggerRepositoryPtr</a> &amp;hierarchy)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Configure <a class="el" href="namespacelog4cxx.html">log4cxx</a> given a configFileName. <a href="#03defb93e089056749f0e5523ec6315f"></a><br></td></tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="84695a8b2e45b1ab42caef5dc65534eb"></a><!-- doxytag: member="log4cxx::helpers::OptionConverter::convertSpecialChars" ref="84695a8b2e45b1ab42caef5dc65534eb" args="(const LogString &amp;s)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> convertSpecialChars </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>s</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="06323a5e7986b04e0799254c8e313b82"></a><!-- doxytag: member="log4cxx::helpers::OptionConverter::findAndSubst" ref="06323a5e7986b04e0799254c8e313b82" args="(const LogString &amp;key, Properties &amp;props)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> findAndSubst </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classlog4cxx_1_1helpers_1_1_properties.html">Properties</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>props</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Find the value corresponding to <code>key</code> in <code>props</code>.
<p>
Then perform variable substitution on the found value. </td>
</tr>
</table>
<a class="anchor" name="e6cbcb2248b2c331c8a6fe1c057f676c"></a><!-- doxytag: member="log4cxx::helpers::OptionConverter::getSystemProperty" ref="e6cbcb2248b2c331c8a6fe1c057f676c" args="(const LogString &amp;key, const LogString &amp;def)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> getSystemProperty </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>def</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Gets the specified system property.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>key</em>&nbsp;</td><td>The key to search for. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>def</em>&nbsp;</td><td>The default value to return. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>the string value of the system property, or the default value if there is no property with that key. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="2bf6497289e61895072587bd71985ea6"></a><!-- doxytag: member="log4cxx::helpers::OptionConverter::instantiateByClassName" ref="2bf6497289e61895072587bd71985ea6" args="(const LogString &amp;className, const Class &amp;superClass, const ObjectPtr &amp;defaultValue)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">ObjectPtr</a> instantiateByClassName </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>className</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const <a class="el" href="classlog4cxx_1_1helpers_1_1_class.html">Class</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>superClass</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">ObjectPtr</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>defaultValue</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Instantiate an object given a class name.
<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 compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>className</em>&nbsp;</td><td>The fully qualified class name of the object to instantiate. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>superClass</em>&nbsp;</td><td>The class to which the new object should belong. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>defaultValue</em>&nbsp;</td><td>The object to return in case of non-fulfillment </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="95d3941c5882b39163dc3f229a2c0317"></a><!-- doxytag: member="log4cxx::helpers::OptionConverter::instantiateByKey" ref="95d3941c5882b39163dc3f229a2c0317" args="(Properties &amp;props, const LogString &amp;key, const Class &amp;superClass, const ObjectPtr &amp;defaultValue)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">ObjectPtr</a> instantiateByKey </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="classlog4cxx_1_1helpers_1_1_properties.html">Properties</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>props</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>key</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const <a class="el" href="classlog4cxx_1_1helpers_1_1_class.html">Class</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>superClass</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">ObjectPtr</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>defaultValue</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="03defb93e089056749f0e5523ec6315f"></a><!-- doxytag: member="log4cxx::helpers::OptionConverter::selectAndConfigure" ref="03defb93e089056749f0e5523ec6315f" args="(const File &amp;configFileName, const LogString &amp;clazz, spi::LoggerRepositoryPtr &amp;hierarchy)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static void selectAndConfigure </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="classlog4cxx_1_1_file.html">File</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>configFileName</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>clazz</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">spi::LoggerRepositoryPtr</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>hierarchy</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Configure <a class="el" href="namespacelog4cxx.html">log4cxx</a> given a configFileName.
<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>
All configurations steps are taken on the <code>hierarchy</code> passed as a parameter.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>configFileName</em>&nbsp;</td><td>The location of the configuration file. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>clazz</em>&nbsp;</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_1_property_configurator.html">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 valign="top"></td><td valign="top"><em>hierarchy</em>&nbsp;</td><td>The <a class="el" href="classlog4cxx_1_1_hierarchy.html">Hierarchy</a> to act on. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="45b8aeeafeace89385672ffab025e9d1"></a><!-- doxytag: member="log4cxx::helpers::OptionConverter::substVars" ref="45b8aeeafeace89385672ffab025e9d1" args="(const LogString &amp;val, Properties &amp;props)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> substVars </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>val</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classlog4cxx_1_1helpers_1_1_properties.html">Properties</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>props</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Perform variable substitution in string <code>val</code> from the values of keys found in the system propeties.
<p>
The variable substitution delimeters are <b>${</b> and <b>}</b>.<p>
For example, if the <a class="el" href="classlog4cxx_1_1helpers_1_1_system.html">System</a> properties contains "key=value", then the call <pre>
String s = OptionConverter.substituteVars("Value of key is ${key}.");
</pre><p>
will set the variable <code>s</code> to "Value of key is value.".<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>
For example, if system propeties contains no value for the key "inexistentKey", then the call<p>
<pre>
String s = OptionConverter.subsVars("Value of inexistentKey is [${inexistentKey}]");
</pre> will set <code>s</code> to "Value of inexistentKey is []"<p>
An <a class="el" href="classlog4cxx_1_1helpers_1_1_illegal_argument_exception.html">IllegalArgumentException</a> is thrown if <code>val</code> contains a start delimeter "${" which is not balanced by a stop delimeter "}". <p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>val</em>&nbsp;</td><td>The string on which variable substitution is performed. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>props</em>&nbsp;</td><td>The properties from which variable substitution is performed. </td></tr>
</table>
</dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="classlog4cxx_1_1helpers_1_1_illegal_argument_exception.html">IllegalArgumentException</a></em>&nbsp;</td><td>if <code>val</code> is malformed. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="6ea7dcdf1610e5d7e7f3d6004db6ef3c"></a><!-- doxytag: member="log4cxx::helpers::OptionConverter::toBoolean" ref="6ea7dcdf1610e5d7e7f3d6004db6ef3c" args="(const LogString &amp;value, bool dEfault)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static bool toBoolean </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>value</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>bool&nbsp;</td>
<td class="mdname" nowrap> <em>dEfault</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
If <code>value</code> is "true", then <code>true</code> is returned.
<p>
If <code>value</code> is "false", then <code>true</code> is returned. Otherwise, <code>default</code> is returned.<p>
Case of value is unimportant. </td>
</tr>
</table>
<a class="anchor" name="f0b5a6bd84b27ef758e7d6d74b362ebf"></a><!-- doxytag: member="log4cxx::helpers::OptionConverter::toFileSize" ref="f0b5a6bd84b27ef758e7d6d74b362ebf" args="(const LogString &amp;value, long dEfault)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static long toFileSize </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>value</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>long&nbsp;</td>
<td class="mdname" nowrap> <em>dEfault</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="c849988e20a74924dae77bc1a6e6e4fb"></a><!-- doxytag: member="log4cxx::helpers::OptionConverter::toInt" ref="c849988e20a74924dae77bc1a6e6e4fb" args="(const LogString &amp;value, int dEfault)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static int toInt </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>value</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>dEfault</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="53e994f695af6def12f5caa8b0f2f5de"></a><!-- doxytag: member="log4cxx::helpers::OptionConverter::toLevel" ref="53e994f695af6def12f5caa8b0f2f5de" args="(const LogString &amp;value, const LevelPtr &amp;defaultValue)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LevelPtr</a> toLevel </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="namespacelog4cxx.html#d7ec98d27bca7666e23f27dd1fb181c8">LogString</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>value</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const <a class="el" href="classlog4cxx_1_1helpers_1_1_object_ptr_t.html">LevelPtr</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>defaultValue</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="optionconverter_8h.html">optionconverter.h</a></ul>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
</BODY>
</HTML>