Move commandline to programs.h
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3082
This commit is contained in:
parent
41a5d9d3d6
commit
61db3e5178
4 changed files with 49 additions and 28 deletions
|
@ -16,6 +16,8 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: programs.h,v 1.15 2008-01-19 11:02:29 qbix79 Exp $ */
|
||||
|
||||
#ifndef DOSBOX_PROGRAMS_H
|
||||
#define DOSBOX_PROGRAMS_H
|
||||
|
||||
|
@ -25,10 +27,39 @@
|
|||
#ifndef DOSBOX_DOS_INC_H
|
||||
#include "dos_inc.h"
|
||||
#endif
|
||||
#ifndef DOSBOX_SETUP_H
|
||||
#include "setup.h"
|
||||
|
||||
#ifndef CH_LIST
|
||||
#define CH_LIST
|
||||
#include <list>
|
||||
#endif
|
||||
|
||||
#ifndef CH_STRING
|
||||
#define CH_STRING
|
||||
#include <string>
|
||||
#endif
|
||||
|
||||
class CommandLine {
|
||||
public:
|
||||
CommandLine(int argc,char const * const argv[]);
|
||||
CommandLine(char const * const name,char const * const cmdline);
|
||||
const char * GetFileName(){ return file_name.c_str();}
|
||||
|
||||
bool FindExist(char const * const name,bool remove=false);
|
||||
bool FindHex(char const * const name,int & value,bool remove=false);
|
||||
bool FindInt(char const * const name,int & value,bool remove=false);
|
||||
bool FindString(char const * const name,std::string & value,bool remove=false);
|
||||
bool FindCommand(unsigned int which,std::string & value);
|
||||
bool FindStringBegin(char const * const begin,std::string & value, bool remove=false);
|
||||
bool FindStringRemain(char const * const name,std::string & value);
|
||||
bool GetStringRemain(std::string & value);
|
||||
unsigned int GetCount(void);
|
||||
void Shift(unsigned int amount=1);
|
||||
private:
|
||||
typedef std::list<std::string>::iterator cmd_it;
|
||||
std::list<std::string> cmds;
|
||||
std::string file_name;
|
||||
bool FindEntry(char const * const name,cmd_it & it,bool neednext=false);
|
||||
};
|
||||
|
||||
class Program {
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue