![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2004 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: arguments.h,v $ $Revision: 1.2 $ $State: Exp $ 00007 *******************************************************************************/ 00008 #ifndef arguments_H_ 00009 #define arguments_H_ 00010 00011 // 00012 // \file arguments.h 00013 // \brief This file contains the declaration of the DtArguments class. 00014 // 00015 00016 #include "tdbutil/tdbUtilDefines.h" 00017 #include <vlutil/vlConfig.h> 00018 #include <list> 00019 #include <string> 00020 00021 00022 // 00023 // Class to create a list of arguments from specified source. It serves to abstract 00024 // away the original source of the arguments (argc/argv, a string, a file, etc). 00025 // Currently, only processes a command line (argc/argv), but could easily be extended 00026 // to process a file, string, etc. 00027 class DT_DLL_tdbutil DtArguments 00028 { 00029 public: 00030 typedef std::string DtArgument; 00031 typedef std::list<DtArgument> DtArgumentContainer; 00032 typedef DtArgumentContainer::iterator DtArgumentIter; 00033 typedef DtArgumentContainer::const_iterator DtArgumentConstIter; 00034 00035 // Reads the arguments from the old argc/argv convention for int main(). 00036 // \note The program name, is @b not read into the arguments list as it is 00037 // not considered an argument. If needed, the user should read that 00038 // out of argv[0] them self. 00039 DtArguments(int argc, const char *argv[]); 00040 00041 virtual ~DtArguments(); 00042 00043 private: 00044 // not implemented 00045 DtArguments& operator=(const DtArguments& other); 00046 DtArguments(const DtArguments& other); 00047 00048 00049 public: 00050 00051 DtArgumentConstIter begin() const; 00052 DtArgumentConstIter end() const; 00053 00054 unsigned numArguments() const; 00055 00056 00057 private: 00058 00059 void addArgument(const std::string& argument); 00060 00061 // the list of arguments, in order specified 00062 DtArgumentContainer myArguments; 00063 }; 00064 00065 00066 #endif