📄 args_8h-source.html
字号:
<!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>args.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>args.h</h1><a href="args_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * args.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * Program Argument Parsing class</span>00005 <span class="comment"> *</span>00006 <span class="comment"> * Portable Windows Library</span>00007 <span class="comment"> *</span>00008 <span class="comment"> * Copyright (c) 1993-1998 Equivalence Pty. Ltd.</span>00009 <span class="comment"> *</span>00010 <span class="comment"> * The contents of this file are subject to the Mozilla Public License</span>00011 <span class="comment"> * Version 1.0 (the "License"); you may not use this file except in</span>00012 <span class="comment"> * compliance with the License. You may obtain a copy of the License at</span>00013 <span class="comment"> * http://www.mozilla.org/MPL/</span>00014 <span class="comment"> *</span>00015 <span class="comment"> * Software distributed under the License is distributed on an "AS IS"</span>00016 <span class="comment"> * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See</span>00017 <span class="comment"> * the License for the specific language governing rights and limitations</span>00018 <span class="comment"> * under the License.</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * The Original Code is Portable Windows Library.</span>00021 <span class="comment"> *</span>00022 <span class="comment"> * The Initial Developer of the Original Code is Equivalence Pty. Ltd.</span>00023 <span class="comment"> *</span>00024 <span class="comment"> * Portions are Copyright (C) 1993 Free Software Foundation, Inc.</span>00025 <span class="comment"> * All Rights Reserved.</span>00026 <span class="comment"> *</span>00027 <span class="comment"> * Contributor(s): ______________________________________.</span>00028 <span class="comment"> *</span>00029 <span class="comment"> * $Log: args.h,v $</span>00030 <span class="comment"> * Revision 1.24 2003/09/17 01:18:01 csoutheren</span>00031 <span class="comment"> * Removed recursive include file system and removed all references</span>00032 <span class="comment"> * to deprecated coooperative threading support</span>00033 <span class="comment"> *</span>00034 <span class="comment"> * Revision 1.23 2003/03/27 07:27:07 robertj</span>00035 <span class="comment"> * Added function to get a bunch of arguments as a string array.</span>00036 <span class="comment"> *</span>00037 <span class="comment"> * Revision 1.22 2002/09/16 01:08:59 robertj</span>00038 <span class="comment"> * Added #define so can select if #pragma interface/implementation is used on</span>00039 <span class="comment"> * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.</span>00040 <span class="comment"> *</span>00041 <span class="comment"> * Revision 1.21 2001/12/15 04:49:06 robertj</span>00042 <span class="comment"> * Added stream I/O functions for argument list.</span>00043 <span class="comment"> *</span>00044 <span class="comment"> * Revision 1.20 2000/05/25 11:05:31 robertj</span>00045 <span class="comment"> * Added PConfigArgs class so can save program arguments to config files.</span>00046 <span class="comment"> *</span>00047 <span class="comment"> * Revision 1.19 1999/03/09 02:59:49 robertj</span>00048 <span class="comment"> * Changed comments to doc++ compatible documentation.</span>00049 <span class="comment"> *</span>00050 <span class="comment"> * Revision 1.18 1999/02/16 08:07:10 robertj</span>00051 <span class="comment"> * MSVC 6.0 compatibility changes.</span>00052 <span class="comment"> *</span>00053 <span class="comment"> * Revision 1.17 1998/11/01 04:56:51 robertj</span>00054 <span class="comment"> * Added BOOl return value to Parse() to indicate there are parameters available.</span>00055 <span class="comment"> *</span>00056 <span class="comment"> * Revision 1.16 1998/10/30 11:22:14 robertj</span>00057 <span class="comment"> * Added constructors that take strings as well as const char *'s.</span>00058 <span class="comment"> *</span>00059 <span class="comment"> * Revision 1.15 1998/10/30 05:24:29 robertj</span>00060 <span class="comment"> * Added return value to << and >> operators for shifting arguments.</span>00061 <span class="comment"> *</span>00062 <span class="comment"> * Revision 1.14 1998/10/29 05:35:14 robertj</span>00063 <span class="comment"> * Fixed porblem with GetCount() == 0 if do not call Parse() function.</span>00064 <span class="comment"> *</span>00065 <span class="comment"> * Revision 1.13 1998/10/28 03:26:41 robertj</span>00066 <span class="comment"> * Added multi character arguments (-abc style) and options precede parameters mode.</span>00067 <span class="comment"> *</span>00068 <span class="comment"> * Revision 1.12 1998/10/28 00:59:46 robertj</span>00069 <span class="comment"> * New improved argument parsing.</span>00070 <span class="comment"> *</span>00071 <span class="comment"> * Revision 1.11 1998/09/23 06:20:14 robertj</span>00072 <span class="comment"> * Added open source copyright license.</span>00073 <span class="comment"> *</span>00074 <span class="comment"> * Revision 1.10 1995/12/10 11:26:38 robertj</span>00075 <span class="comment"> * Fixed signed/unsigned bug in shift count.</span>00076 <span class="comment"> *</span>00077 <span class="comment"> * Revision 1.9 1995/06/17 11:12:17 robertj</span>00078 <span class="comment"> * Documentation update.</span>00079 <span class="comment"> *</span>00080 <span class="comment"> * Revision 1.8 1995/03/14 12:40:58 robertj</span>00081 <span class="comment"> * Updated documentation to use HTML codes.</span>00082 <span class="comment"> *</span>00083 <span class="comment"> * Revision 1.7 1994/12/05 11:15:13 robertj</span>00084 <span class="comment"> * Documentation.</span>00085 <span class="comment"> *</span>00086 <span class="comment"> * Revision 1.6 1994/11/26 03:44:19 robertj</span>00087 <span class="comment"> * Documentation.</span>00088 <span class="comment"> *</span>00089 <span class="comment"> * Revision 1.6 1994/11/24 11:48:26 robertj</span>00090 <span class="comment"> * Documentation.</span>00091 <span class="comment"> *</span>00092 <span class="comment"> * Revision 1.5 1994/08/23 11:32:52 robertj</span>00093 <span class="comment"> * Oops</span>00094 <span class="comment"> *</span>00095 <span class="comment"> * Revision 1.4 1994/08/22 00:46:48 robertj</span>00096 <span class="comment"> * Added pragma fro GNU C++ compiler.</span>00097 <span class="comment"> *</span>00098 <span class="comment"> * Revision 1.3 1994/07/27 05:58:07 robertj</span>00099 <span class="comment"> * Synchronisation.</span>00100 <span class="comment"> *</span>00101 <span class="comment"> * Revision 1.2 1994/07/17 10:46:06 robertj</span>00102 <span class="comment"> * Changed to use container classes to plug memory leak.</span>00103 <span class="comment"> *</span>00104 <span class="comment"> * Revision 1.1 1994/04/01 14:08:52 robertj</span>00105 <span class="comment"> * Initial revision</span>00106 <span class="comment"> *</span>00107 <span class="comment"> */</span>00108 00109 <span class="preprocessor">#ifndef _PARGLIST</span>00110 <span class="preprocessor"></span><span class="preprocessor">#define _PARGLIST</span>00111 <span class="preprocessor"></span>00112 <span class="preprocessor">#ifdef P_USE_PRAGMA</span>00113 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span>00114 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00115 <span class="preprocessor"></span><a name="l00120"></a><a class="code" href="classPArgList.html">00120</a> <span class="keyword">class </span><a class="code" href="classPArgList.html">PArgList</a> : <span class="keyword">public</span> <a class="code" href="classPObject.html">PObject</a>00121 {00122 <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPArgList.html">PArgList</a>, <a class="code" href="classPObject.html">PObject</a>);00123 00124 <span class="keyword">public</span>:00137 <a class="code" href="classPArgList.html#z3_0">PArgList</a>(00138 <span class="keyword">const</span> <span class="keywordtype">char</span> * theArgPtr = NULL, 00139 <span class="keyword">const</span> <span class="keywordtype">char</span> * argumentSpecPtr = NULL,00143 BOOL optionsBeforeParams = TRUE 00144 );00146 <a class="code" href="classPArgList.html#z3_0">PArgList</a>(00147 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & theArgStr, 00148 <span class="keyword">const</span> <span class="keywordtype">char</span> * argumentSpecPtr = NULL,00152 BOOL optionsBeforeParams = TRUE 00153 );00155 <a class="code" href="classPArgList.html#z3_0">PArgList</a>(00156 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & theArgStr, 00157 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & argumentSpecStr,00161 BOOL optionsBeforeParams = TRUE 00162 );00164 <a class="code" href="classPArgList.html#z3_0">PArgList</a>(00165 <span class="keywordtype">int</span> theArgc, 00166 <span class="keywordtype">char</span> ** theArgv, 00167 <span class="keyword">const</span> <span class="keywordtype">char</span> * argumentSpecPtr = NULL,00171 BOOL optionsBeforeParams = TRUE 00172 );00174 <a class="code" href="classPArgList.html#z3_0">PArgList</a>(00175 <span class="keywordtype">int</span> theArgc, 00176 <span class="keywordtype">char</span> ** theArgv, 00177 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & argumentSpecStr,00181 BOOL optionsBeforeParams = TRUE 00182 );00184 00189 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPArgList.html#z5_0">PrintOn</a>(00190 ostream & strm 00191 ) <span class="keyword">const</span>;00192 00196 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPArgList.html#z5_1">ReadFrom</a>(00197 istream & strm 00198 );00200 00205 <span class="keywordtype">void</span> <a class="code" href="classPArgList.html#z7_0">SetArgs</a>(00206 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & theArgStr 00207 );00209 <span class="keywordtype">void</span> <a class="code" href="classPArgList.html#z7_0">SetArgs</a>(00210 <span class="keywordtype">int</span> theArgc,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -