Leaked source code of windows server 2003
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.

46 lines
1.3 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Simple parameter string parsing.
  4. //
  5. // Copyright (C) Microsoft Corporation, 2000-2002.
  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,
  25. PSTR Name, ULONG NameSize,
  26. PSTR Value, ULONG ValueSize) = 0;
  27. virtual void ResetParameters(void) = 0;
  28. virtual BOOL SetParameter(PCSTR Name, PCSTR Value) = 0;
  29. BOOL ParseParameters(PCSTR ParamString);
  30. BOOL GetParameters(PSTR Buffer, ULONG BufferSize);
  31. // Scan the names array for the <name> part of
  32. // a <name>:<parameters> string.
  33. static ULONG GetParser(PCSTR ParamString, ULONG NumNames, PCSTR* Names);
  34. };
  35. #endif // #ifndef __PPARSE_HPP__