Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > b91608bcc8cdfae85c75f04c03683d58 > files > 329

lib64dirac-devel-0.9.1-1mdv2008.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Dirac Video Codec</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<h1 align="center" color="#606080">
Dirac - A Video Codec
</h1>
<p align="center">
Created by the <a href="http://www.bbc.co.uk">British Broadcasting Corporation</a>.
</p>
<hr>
<!-- Generated by Doxygen 1.5.4 -->
<h1>cmd_line.h</h1><a href="a00165.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* ***** BEGIN LICENSE BLOCK *****</span>
<a name="l00002"></a>00002 <span class="comment">*</span>
<a name="l00003"></a>00003 <span class="comment">* $Id: cmd_line.h,v 1.7 2004/11/22 14:05:02 asuraparaju Exp $ $Name: Dirac_0_9_1 $</span>
<a name="l00004"></a>00004 <span class="comment">*</span>
<a name="l00005"></a>00005 <span class="comment">* Version: MPL 1.1/GPL 2.0/LGPL 2.1</span>
<a name="l00006"></a>00006 <span class="comment">*</span>
<a name="l00007"></a>00007 <span class="comment">* The contents of this file are subject to the Mozilla Public License</span>
<a name="l00008"></a>00008 <span class="comment">* Version 1.1 (the "License"); you may not use this file except in compliance</span>
<a name="l00009"></a>00009 <span class="comment">* with the License. You may obtain a copy of the License at</span>
<a name="l00010"></a>00010 <span class="comment">* http://www.mozilla.org/MPL/</span>
<a name="l00011"></a>00011 <span class="comment">*</span>
<a name="l00012"></a>00012 <span class="comment">* Software distributed under the License is distributed on an "AS IS" basis,</span>
<a name="l00013"></a>00013 <span class="comment">* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for</span>
<a name="l00014"></a>00014 <span class="comment">* the specific language governing rights and limitations under the License.</span>
<a name="l00015"></a>00015 <span class="comment">*</span>
<a name="l00016"></a>00016 <span class="comment">* The Original Code is BBC Research and Development code.</span>
<a name="l00017"></a>00017 <span class="comment">*</span>
<a name="l00018"></a>00018 <span class="comment">* The Initial Developer of the Original Code is the British Broadcasting</span>
<a name="l00019"></a>00019 <span class="comment">* Corporation.</span>
<a name="l00020"></a>00020 <span class="comment">* Portions created by the Initial Developer are Copyright (C) 2004.</span>
<a name="l00021"></a>00021 <span class="comment">* All Rights Reserved.</span>
<a name="l00022"></a>00022 <span class="comment">*</span>
<a name="l00023"></a>00023 <span class="comment">* Contributor(s): Scott R Ladd (Original Author), Thomas Davies</span>
<a name="l00024"></a>00024 <span class="comment">*</span>
<a name="l00025"></a>00025 <span class="comment">* Alternatively, the contents of this file may be used under the terms of</span>
<a name="l00026"></a>00026 <span class="comment">* the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser</span>
<a name="l00027"></a>00027 <span class="comment">* Public License Version 2.1 (the "LGPL"), in which case the provisions of</span>
<a name="l00028"></a>00028 <span class="comment">* the GPL or the LGPL are applicable instead of those above. If you wish to</span>
<a name="l00029"></a>00029 <span class="comment">* allow use of your version of this file only under the terms of the either</span>
<a name="l00030"></a>00030 <span class="comment">* the GPL or LGPL and not to allow others to use your version of this file</span>
<a name="l00031"></a>00031 <span class="comment">* under the MPL, indicate your decision by deleting the provisions above</span>
<a name="l00032"></a>00032 <span class="comment">* and replace them with the notice and other provisions required by the GPL</span>
<a name="l00033"></a>00033 <span class="comment">* or LGPL. If you do not delete the provisions above, a recipient may use</span>
<a name="l00034"></a>00034 <span class="comment">* your version of this file under the terms of any one of the MPL, the GPL</span>
<a name="l00035"></a>00035 <span class="comment">* or the LGPL.</span>
<a name="l00036"></a>00036 <span class="comment">* ***** END LICENSE BLOCK ***** */</span>
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="preprocessor">#if !defined(LIBDIRAC_CMD_LINE_H)</span>
<a name="l00039"></a><a class="code" href="a00165.html#97809c317804fff6e40fc0162d66a8c7">00039</a> <span class="preprocessor"></span><span class="preprocessor">#define LIBDIRAC_CMD_LINE_H</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="comment">// Standard C++</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00043"></a>00043 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00044"></a>00044 <span class="preprocessor">#include &lt;set&gt;</span>
<a name="l00045"></a>00045 
<a name="l00046"></a>00046 <span class="keyword">namespace </span>dirac
<a name="l00047"></a>00047 {
<a name="l00048"></a>00048    <span class="comment">// structure for defining the nature of options</span>
<a name="l00049"></a>00049    <span class="comment">// a very simple command-line parser</span>
<a name="l00050"></a><a class="code" href="a00024.html">00050</a>    <span class="keyword">class </span><a class="code" href="a00024.html">CommandLine</a>
<a name="l00051"></a>00051    {
<a name="l00052"></a>00052    <span class="keyword">public</span>:
<a name="l00053"></a><a class="code" href="a00025.html">00053</a>        <span class="keyword">struct </span><a class="code" href="a00025.html">option</a>
<a name="l00054"></a>00054        {
<a name="l00055"></a><a class="code" href="a00025.html#5b5f411f10b5ef0c5cecdf6c14d5e02c">00055</a>            std::string <a class="code" href="a00025.html#5b5f411f10b5ef0c5cecdf6c14d5e02c">m_name</a>;
<a name="l00056"></a><a class="code" href="a00025.html#72e09221c4ad15d2a548db5db9ea5bfc">00056</a>            std::string <a class="code" href="a00025.html#72e09221c4ad15d2a548db5db9ea5bfc">m_value</a>;
<a name="l00057"></a>00057 
<a name="l00058"></a><a class="code" href="a00025.html#c98afdc4c1e52670f4079e666a900381">00058</a>            <a class="code" href="a00025.html#c98afdc4c1e52670f4079e666a900381">option</a>(<span class="keyword">const</span> std::string &amp; a_name)
<a name="l00059"></a>00059            : <a class="code" href="a00025.html#5b5f411f10b5ef0c5cecdf6c14d5e02c">m_name</a>(a_name), <a class="code" href="a00025.html#72e09221c4ad15d2a548db5db9ea5bfc">m_value</a>(<span class="stringliteral">""</span>)
<a name="l00060"></a>00060            {
<a name="l00061"></a>00061                <span class="comment">// nada</span>
<a name="l00062"></a>00062            }
<a name="l00063"></a>00063        };
<a name="l00064"></a>00064 
<a name="l00066"></a>00066        <a class="code" href="a00024.html#86ee25d45f7b0673da3585b6d471af50" title="Constructor.">CommandLine</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> * argv[], <span class="keyword">const</span> std::set&lt;std::string&gt; &amp; bool_opts);
<a name="l00067"></a>00067 
<a name="l00068"></a><a class="code" href="a00024.html#bdaabf1dd2fa4f7fbc4e94690a6e790d">00068</a>        <span class="keyword">const</span> std::vector&lt;option&gt; &amp; <a class="code" href="a00024.html#bdaabf1dd2fa4f7fbc4e94690a6e790d">GetOptions</a>()<span class="keyword"> const</span>
<a name="l00069"></a>00069 <span class="keyword">       </span>{
<a name="l00070"></a>00070            <span class="keywordflow">return</span> <a class="code" href="a00024.html#645e45ca20990549f859d095e280680e">m_options</a>;
<a name="l00071"></a>00071        }
<a name="l00072"></a>00072 
<a name="l00073"></a><a class="code" href="a00024.html#ecdf4e3d1e76b5cc0d5a5512a93850b4">00073</a>        <span class="keyword">const</span> std::vector&lt;std::string&gt; &amp; <a class="code" href="a00024.html#ecdf4e3d1e76b5cc0d5a5512a93850b4">GetInputs</a>()<span class="keyword"> const</span>
<a name="l00074"></a>00074 <span class="keyword">       </span>{
<a name="l00075"></a>00075            <span class="keywordflow">return</span> <a class="code" href="a00024.html#453f0cd1c8e1f414fefffe018a3799c6">m_inputs</a>;
<a name="l00076"></a>00076        }
<a name="l00077"></a>00077        
<a name="l00078"></a>00078        <span class="comment">// convenience property</span>
<a name="l00079"></a><a class="code" href="a00024.html#4e606fc57053e92bd28f9863d6d40860">00079</a>        <span class="keywordtype">size_t</span> <a class="code" href="a00024.html#4e606fc57053e92bd28f9863d6d40860">Count</a>()<span class="keyword"> const</span>
<a name="l00080"></a>00080 <span class="keyword">       </span>{
<a name="l00081"></a>00081            <span class="keywordflow">return</span> <a class="code" href="a00024.html#645e45ca20990549f859d095e280680e">m_options</a>.size();
<a name="l00082"></a>00082        }
<a name="l00083"></a>00083 
<a name="l00084"></a>00084    <span class="keyword">private</span>:
<a name="l00085"></a><a class="code" href="a00024.html#645e45ca20990549f859d095e280680e">00085</a>        std::vector&lt;option&gt;      <a class="code" href="a00024.html#645e45ca20990549f859d095e280680e">m_options</a>;
<a name="l00086"></a><a class="code" href="a00024.html#453f0cd1c8e1f414fefffe018a3799c6">00086</a>        std::vector&lt;std::string&gt; <a class="code" href="a00024.html#453f0cd1c8e1f414fefffe018a3799c6">m_inputs</a>;
<a name="l00087"></a><a class="code" href="a00024.html#370835ee55455d3cee946c0d0fed2912">00087</a>        <span class="keyword">const</span> std::set&lt;std::string&gt; &amp; <a class="code" href="a00024.html#370835ee55455d3cee946c0d0fed2912">m_bool_opts</a>;
<a name="l00088"></a>00088    };
<a name="l00089"></a>00089 
<a name="l00090"></a>00090 } <span class="comment">// namespace dirac</span>
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 <span class="preprocessor">#endif</span>
</pre></div><hr>
<p align="center"><small>
&copy; 2004 British Broadcasting Corporation.
Dirac code licensed under the <a href="http://www.mozilla.org/MPL/">Mozilla Public License (MPL) Version 1.1</a>.<br>
HTML documentation generated by Dimitri van Heesch's
excellent <a href="http://www.doxygen.org">Doxygen</a> tool.
</small></p>
</body>
</html>