Odamex
Setting the Standard in Multiplayer Doom
common/m_argv.h
Go to the documentation of this file.
00001 // Emacs style mode select   -*- C++ -*-
00002 //-----------------------------------------------------------------------------
00003 //
00004 // $Id: m_argv.h 2054 2011-01-26 05:12:02Z mike $
00005 //
00006 // Copyright (C) 1993-1996 by id Software, Inc.
00007 // Copyright (C) 2006-2010 by The Odamex Team.
00008 //
00009 // This program is free software; you can redistribute it and/or
00010 // modify it under the terms of the GNU General Public License
00011 // as published by the Free Software Foundation; either version 2
00012 // of the License, or (at your option) any later version.
00013 //
00014 // This program is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // DESCRIPTION:
00020 //  Command-line arguments
00021 //
00022 //-----------------------------------------------------------------------------
00023 
00024 
00025 #ifndef __M_ARGV_H__
00026 #define __M_ARGV_H__
00027 
00028 #include "dobject.h"
00029 #include "doomtype.h"
00030 
00031 #include <string>
00032 #include <vector>
00033 
00034 //
00035 // MISC
00036 //
00037 class DArgs : public DObject
00038 {
00039         DECLARE_CLASS (DArgs, DObject)
00040 public:
00041         DArgs ();
00042         DArgs (const DArgs &args);
00043         DArgs (unsigned int argc, char **argv);
00044         DArgs (const char *cmdline);
00045         ~DArgs ();
00046 
00047         DArgs &operator= (const DArgs &other);
00048         const char *operator[] (size_t n);
00049 
00050         void AppendArg (const char *arg);
00051         void SetArgs (unsigned int argc, char **argv);
00052         void SetArgs(const char *cmdline);
00053         DArgs GatherFiles (const char *param, const char *extension, bool acceptNoExt) const;
00054         void SetArg (unsigned int argnum, const char *arg);
00055 
00056 
00057         // Returns the position of the given parameter
00058         // in the arg list (0 if not found).
00059         size_t CheckParm (const char *check) const;
00060         const char *CheckValue (const char *check) const;
00061         const char *GetArg (size_t arg) const;
00062         const std::vector<std::string> GetArgList (size_t start) const;
00063         size_t NumArgs () const;
00064         void FlushArgs ();
00065 
00066 private:
00067 
00068         std::vector<std::string> args;
00069 
00070         void CopyArgs (unsigned int argc, char **argv);
00071 
00072 };
00073 
00074 extern DArgs Args;
00075 
00076 void M_FindResponseFile(void);
00077 
00078 extern bool DefaultsLoaded; 
00079 
00080 #endif //__M_ARGV_H__
00081 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends