メインページ   クラス階層   構成   ファイル一覧   構成メンバ   ファイルメンバ  

prog-args.h

解説を見る。
00001 /*
00002 
00003 Copyright (C) 1996, 1997 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 2, or (at your option) any
00010 later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, write to the Free
00019 Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020 
00021 */
00022 
00023 #if !defined (octave_prog_args_h)
00024 #define octave_prog_args_h 1
00025 
00026 struct
00027 long_options
00028 {
00029   const char *name;
00030   int has_arg;
00031   int *flag;
00032   int val;
00033 };
00034 
00035 class
00036 prog_args
00037 {
00038 public:
00039 
00040   // These values must match the corresponding defines in getopt.h.
00041   enum option_argument
00042     {
00043       no_arg = 0,
00044       required_arg = 1,
00045       optional_arg = 2
00046     };
00047 
00048   prog_args (int argc, char *const *argv, const char *s_opts, const
00049              long_options* l_opts = 0)
00050     : xargc (argc), xargv (argv), short_opts (s_opts), long_opts (l_opts)
00051       {
00052         init ();
00053       }
00054 
00055   ~prog_args (void) { }
00056 
00057   int getopt (void);
00058 
00059   const char *optarg (void);
00060 
00061   int optind (void);
00062 
00063 private:
00064 
00065   // Number of args.
00066   int xargc;
00067 
00068   // Program args.
00069   char *const *xargv;
00070 
00071   // Single character options.
00072   const char *short_opts;
00073 
00074   // Long options.
00075   const long_options *long_opts;
00076 
00077   void init (void);
00078 
00079   prog_args (const prog_args&);
00080 
00081   prog_args& operator = (const prog_args&);
00082 };
00083 
00084 #endif
00085 
00086 /*
00087 ;;; Local Variables: ***
00088 ;;; mode: C++ ***
00089 ;;; End: ***
00090 */

Wed Dec 29 11:52:16 2004に生成されました。 doxygen1.2.18
SEO [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送