Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates > by-pkgid > 8b93c7974abbd359ec3a5ea81eee3220 > files > 936

exiv2-doc-0.24-5.2.mga5.noarch.rpm

<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>Exiv2: Util::Getopt 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="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.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 style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Exiv2
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceUtil.html">Util</a></li><li class="navelem"><a class="el" href="classUtil_1_1Getopt.html">Getopt</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classUtil_1_1Getopt-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Util::Getopt Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p>Parse the command line options of a program.  
 <a href="classUtil_1_1Getopt.html#details">More...</a></p>

<p><code>#include &lt;utils.hpp&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for Util::Getopt:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classUtil_1_1Getopt__inherit__graph.png" border="0" usemap="#Util_1_1Getopt_inherit__map" alt="Inheritance graph"/></div>
<map name="Util_1_1Getopt_inherit__map" id="Util_1_1Getopt_inherit__map">
<area shape="rect" id="node2" href="classParams.html" title="Implements the command line handling for the program. " alt="" coords="35,80,118,107"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab376b23300a3609929509138b218f91f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab376b23300a3609929509138b218f91f"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtil_1_1Getopt.html#ab376b23300a3609929509138b218f91f">Getopt</a> ()</td></tr>
<tr class="memdesc:ab376b23300a3609929509138b218f91f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <br /></td></tr>
<tr class="separator:ab376b23300a3609929509138b218f91f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a542727221bc93c62f074e9fdb5a3d220"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a542727221bc93c62f074e9fdb5a3d220"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtil_1_1Getopt.html#a542727221bc93c62f074e9fdb5a3d220">~Getopt</a> ()</td></tr>
<tr class="memdesc:a542727221bc93c62f074e9fdb5a3d220"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:a542727221bc93c62f074e9fdb5a3d220"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0f18bdea00878d0e8a9e83370a0812e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtil_1_1Getopt.html#ae0f18bdea00878d0e8a9e83370a0812e">getopt</a> (int argc, char *const argv[], const std::string &amp;optstring)</td></tr>
<tr class="memdesc:ae0f18bdea00878d0e8a9e83370a0812e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse command line arguments.  <a href="#ae0f18bdea00878d0e8a9e83370a0812e">More...</a><br /></td></tr>
<tr class="separator:ae0f18bdea00878d0e8a9e83370a0812e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27e365f1f9710ce80f4b534686d7e887"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtil_1_1Getopt.html#a27e365f1f9710ce80f4b534686d7e887">option</a> (int opt, const std::string &amp;optarg, int optopt)=0</td></tr>
<tr class="memdesc:a27e365f1f9710ce80f4b534686d7e887"><td class="mdescLeft">&#160;</td><td class="mdescRight">Callback used by <a class="el" href="classUtil_1_1Getopt.html#ae0f18bdea00878d0e8a9e83370a0812e" title="Parse command line arguments. ">getopt()</a> to pass on each option and its argument (if any).  <a href="#a27e365f1f9710ce80f4b534686d7e887">More...</a><br /></td></tr>
<tr class="separator:a27e365f1f9710ce80f4b534686d7e887"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af182b096eb3da4ce48c1bbb8b84817b1"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtil_1_1Getopt.html#af182b096eb3da4ce48c1bbb8b84817b1">nonoption</a> (const std::string &amp;argv)</td></tr>
<tr class="memdesc:af182b096eb3da4ce48c1bbb8b84817b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Callback used by <a class="el" href="classUtil_1_1Getopt.html#ae0f18bdea00878d0e8a9e83370a0812e" title="Parse command line arguments. ">getopt()</a> to pass on each non-option parameter found on the command line.  <a href="#af182b096eb3da4ce48c1bbb8b84817b1">More...</a><br /></td></tr>
<tr class="separator:af182b096eb3da4ce48c1bbb8b84817b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad9bfd88842108ef3506c3567bc63dec0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad9bfd88842108ef3506c3567bc63dec0"></a>
const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtil_1_1Getopt.html#ad9bfd88842108ef3506c3567bc63dec0">progname</a> () const </td></tr>
<tr class="memdesc:ad9bfd88842108ef3506c3567bc63dec0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Program name (argv[0]) <br /></td></tr>
<tr class="separator:ad9bfd88842108ef3506c3567bc63dec0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a504c4af3e01af5466459c03a90bafb83"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a504c4af3e01af5466459c03a90bafb83"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classUtil_1_1Getopt.html#a504c4af3e01af5466459c03a90bafb83">errcnt</a> () const </td></tr>
<tr class="memdesc:a504c4af3e01af5466459c03a90bafb83"><td class="mdescLeft">&#160;</td><td class="mdescRight">Total number of errors returned by calls to <a class="el" href="classUtil_1_1Getopt.html#a27e365f1f9710ce80f4b534686d7e887" title="Callback used by getopt() to pass on each option and its argument (if any). ">option()</a> <br /></td></tr>
<tr class="separator:a504c4af3e01af5466459c03a90bafb83"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Parse the command line options of a program. </p>
<p>A wrapper around the POSIX getopt(3) function. Parses the command line options and passes each option to virtual <a class="el" href="classUtil_1_1Getopt.html#a27e365f1f9710ce80f4b534686d7e887" title="Callback used by getopt() to pass on each option and its argument (if any). ">option()</a>. A derived class implements this method to handle options as needed. Similarly, remaining non-option parameters are passed to the virtual <a class="el" href="classUtil_1_1Getopt.html#af182b096eb3da4ce48c1bbb8b84817b1" title="Callback used by getopt() to pass on each non-option parameter found on the command line...">nonoption()</a> method. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ae0f18bdea00878d0e8a9e83370a0812e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Util::Getopt::getopt </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>argv</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>optstring</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parse command line arguments. </p>
<p>Parses the command line arguments. Calls <a class="el" href="classUtil_1_1Getopt.html#a27e365f1f9710ce80f4b534686d7e887" title="Callback used by getopt() to pass on each option and its argument (if any). ">option()</a> with the character value of the option and its argument (if any) for each recognized option and with ':' or '?' for unrecognized options. See the manual pages for getopt(3) for details. In addition, <a class="el" href="classUtil_1_1Getopt.html#af182b096eb3da4ce48c1bbb8b84817b1" title="Callback used by getopt() to pass on each non-option parameter found on the command line...">nonoption()</a> is invoked for each remaining non-option parameter on the command line.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">argc</td><td>Argument count as passed to main() on program invocation. </td></tr>
    <tr><td class="paramname">argv</td><td>Argument array as passed to main() on program invocation. </td></tr>
    <tr><td class="paramname">optstring</td><td>String containing the legitimate option characters.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of errors (the sum of the return values from <a class="el" href="classUtil_1_1Getopt.html#a27e365f1f9710ce80f4b534686d7e887" title="Callback used by getopt() to pass on each option and its argument (if any). ">option()</a> and <a class="el" href="classUtil_1_1Getopt.html#af182b096eb3da4ce48c1bbb8b84817b1" title="Callback used by getopt() to pass on each non-option parameter found on the command line...">nonoption()</a>). </dd></dl>

<p>References <a class="el" href="namespaceUtil.html#a0ec92119bdb7f1269693f1ee94d360ea">Util::basename()</a>, <a class="el" href="classUtil_1_1Getopt.html#af182b096eb3da4ce48c1bbb8b84817b1">nonoption()</a>, and <a class="el" href="classUtil_1_1Getopt.html#a27e365f1f9710ce80f4b534686d7e887">option()</a>.</p>

<p>Referenced by <a class="el" href="classParams.html#a3ba82915162067d66a83b54bca05e241">Params::getopt()</a>.</p>

</div>
</div>
<a class="anchor" id="af182b096eb3da4ce48c1bbb8b84817b1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int Util::Getopt::nonoption </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>argv</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Callback used by <a class="el" href="classUtil_1_1Getopt.html#ae0f18bdea00878d0e8a9e83370a0812e" title="Parse command line arguments. ">getopt()</a> to pass on each non-option parameter found on the command line. </p>
<p>Implement this method in a derived class to handle the non-option parameters as needed. The default implementation ignores all non-option parameters.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">argv</td><td>The non-option parameter from the command line.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, 1 in case of an error. </dd></dl>

<p>Reimplemented in <a class="el" href="classParams.html#a00a1171555548b5903e52a12354309b4">Params</a>.</p>

<p>Referenced by <a class="el" href="classUtil_1_1Getopt.html#ae0f18bdea00878d0e8a9e83370a0812e">getopt()</a>.</p>

</div>
</div>
<a class="anchor" id="a27e365f1f9710ce80f4b534686d7e887"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int Util::Getopt::option </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>opt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>optarg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>optopt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Callback used by <a class="el" href="classUtil_1_1Getopt.html#ae0f18bdea00878d0e8a9e83370a0812e" title="Parse command line arguments. ">getopt()</a> to pass on each option and its argument (if any). </p>
<p>Implement this method in a derived class to handle the options as needed. See the manual pages for getopt(3) for further details, in particular, the semantics of optarg and optopt.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">opt</td><td>Value of the option character as returned by getopt(3). </td></tr>
    <tr><td class="paramname">optarg</td><td>The corresponding option argument. </td></tr>
    <tr><td class="paramname">optopt</td><td>The actual option character in case of an unrecognized option or a missing option argument (opt is '?' or ':').</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, 1 in case of an error. </dd></dl>

<p>Implemented in <a class="el" href="classParams.html#a8d28eab356e60994d9bcf6c9c6ff1cdb">Params</a>.</p>

<p>Referenced by <a class="el" href="classUtil_1_1Getopt.html#ae0f18bdea00878d0e8a9e83370a0812e">getopt()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="utils_8hpp.html">utils.hpp</a></li>
<li>utils.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Oct 26 2017 16:50:16 for Exiv2 by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>