home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-01-02 | 958 b | 42 lines | [TEXT/CWIE] |
- // ===========================================================================
- // CArgumentParser.h ©1996 Microsoft Corporation. All rights reserved.
- // ===========================================================================
-
-
- typedef enum
- {
- Alpha = 0, Numeric, WhiteSpace, Assignment, Quote, Unknown, EOF, CharTypeCount
- }
- chartype;
-
- typedef enum
- {
- AddToBuffer = 0, TermArgName, TermArgValue, None, Error
- }
- parseraction;
-
- typedef enum
- {
- WaitArgName = 0, BuildArgName, WaitAssign, WaitArgValue, BuildArgVal, BuildArgValLit, Undefined,
- StateCount, Stop = WaitArgName
- }
- parserstate;
-
- class CArgumentParser
- {
- public:
- CArgumentParser(void);
- ~CArgumentParser(void);
-
- void Reset(void);
- Boolean ProcessChar(char c);
- Boolean GetArguments(Ptr *ArgBuffer, char **ArgNames[], char **ArgValues[], short *ArgCount);
-
- protected:
-
- private:
- Handle Buffer;
- char InputBuffer[256];
- Uint16 InputBufferCount;
- parserstate CurrentState;
- };