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.

67 lines
1.5 KiB

  1. //+------------------------------------------------------------------
  2. //
  3. // File: nstrlist.hxx
  4. //
  5. // Contents: class definitions for NCHAR string list.
  6. //
  7. // Classes: CnStrList
  8. //
  9. // History: 23 Dec 93 XimingZ Created.
  10. //
  11. //-------------------------------------------------------------------
  12. #ifndef __NSTRLIST_HXX__
  13. #define __NSTRLIST_HXX__
  14. #include <windows.h>
  15. #include <nchar.h>
  16. #ifdef WIN16
  17. #include <ptypes16.h>
  18. #endif
  19. // Cmdline Success/Error values
  20. #define NSTRLIST_NO_ERROR 0
  21. #define NSTRLIST_ERROR_BASE 10000
  22. #define NSTRLIST_ERROR_OUT_OF_MEMORY NSTRLIST_ERROR_BASE+2
  23. //+------------------------------------------------------------------
  24. //
  25. // Class: CnStrList
  26. //
  27. // Purpose: implementation for NCHAR string list.
  28. //
  29. // History: 12/23/93 XimingZ Created
  30. //
  31. //-------------------------------------------------------------------
  32. class CnStrList
  33. {
  34. public:
  35. CnStrList(LPCNSTR pwszItems, LPCNSTR pwszDelims);
  36. ~CnStrList(VOID);
  37. INT QueryError(VOID) { return _iLastError; };
  38. LPCNSTR Next(VOID);
  39. VOID Reset(VOID);
  40. BOOL Append(LPCNSTR pnszItem);
  41. private:
  42. struct NSTRLIST
  43. {
  44. PNSTR pnszStr;
  45. NSTRLIST *pNext;
  46. };
  47. VOID SetError(INT iLastError) { _iLastError = iLastError; };
  48. NSTRLIST *_head;
  49. NSTRLIST *_tail;
  50. NSTRLIST *_next;
  51. INT _iLastError;
  52. };
  53. #endif // __NSTRLIST_HXX__