#ifndef _PROTO_COMMANDLINE_HPP_ #define _PROTO_COMMANDLINE_HPP_ #ifndef _COMMON_WINDOWS_HPP_ #include #endif #ifndef _COMMON_BLOCK_HPP_ #include #endif #ifndef _COMMON_STRING_HPP_ #include #endif class CommandLine { public: CommandLine(String commandLine=::GetCommandLine()); virtual ~CommandLine(); BOOL operator++(void); BOOL operator++(int postFixDummy); BOOL operator--(void); BOOL operator--(int postFixDummy); String argument(void)const; String option(void)const; String optionArg(void)const; BOOL isOption(void)const; private: void createCommands(String commandLine); Block mBlockCmds; int mArgIndex; }; inline CommandLine::CommandLine(String commandLine) : mArgIndex(0) { createCommands(commandLine); } inline CommandLine::~CommandLine() { } inline BOOL CommandLine::operator++(void) { if(mArgIndex+1>=mBlockCmds.size())return FALSE; mArgIndex++; return TRUE; } inline BOOL CommandLine::operator--(void) { if(mArgIndex-1<0)return FALSE; mArgIndex--; return TRUE; } inline BOOL CommandLine::operator++(int /*postFixDummy*/) { if(mArgIndex+1>=mBlockCmds.size())return FALSE; mArgIndex++; return TRUE; } inline BOOL CommandLine::operator--(int /*postFixDummy*/) { if(mArgIndex-1<0)return FALSE; mArgIndex--; return TRUE; } #endif