Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Simple parameter string parsing.
  4. //
  5. // Copyright (C) Microsoft Corporation, 2000.
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifndef __PPARSE_HPP__
  9. #define __PPARSE_HPP__
  10. //----------------------------------------------------------------------------
  11. //
  12. // ParameterStringParser.
  13. //
  14. //----------------------------------------------------------------------------
  15. #define MAX_PARAM_NAME 32
  16. #define MAX_PARAM_VALUE 256
  17. #define PARSER_INVALID 0xffffffff
  18. class ParameterStringParser
  19. {
  20. public:
  21. PCSTR m_Name;
  22. ParameterStringParser(void);
  23. virtual ULONG GetNumberParameters(void) = 0;
  24. virtual void GetParameter(ULONG Index, PSTR Name, PSTR Value) = 0;
  25. virtual void ResetParameters(void) = 0;
  26. virtual BOOL SetParameter(PCSTR Name, PCSTR Value) = 0;
  27. BOOL ParseParameters(PCSTR ParamString);
  28. BOOL GetParameters(PSTR Buffer, ULONG BufferSize);
  29. // Scan the names array for the <name> part of
  30. // a <name>:<parameters> string.
  31. static ULONG GetParser(PCSTR ParamString, ULONG NumNames, PCSTR* Names);
  32. };
  33. #endif // #ifndef __PPARSE_HPP__