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.

58 lines
1.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File: fparse.hxx
  8. //
  9. // Contents: File parsing api -- INI file types
  10. //
  11. // History: 01-Oct-1997 pberkman create
  12. //
  13. //--------------------------------------------------------------------------
  14. #ifndef FPARSE_HXX
  15. #define FPARSE_HXX
  16. class fParse_
  17. {
  18. public:
  19. fParse_(WCHAR *pwszFilename, BOOL *pfFailed, DWORD dwMaxLine0 = MAX_PATH,
  20. DWORD dwFileAccess = GENERIC_READ, DWORD dwFileSharing = FILE_SHARE_READ);
  21. virtual ~fParse_(void);
  22. void Reset(void);
  23. WCHAR *GetCurrentLine(void) { return(pwszCurrentLine); }
  24. DWORD GetNextLine(void);
  25. BOOL FindTagInCurrentGroup(WCHAR *pwszTag);
  26. BOOL GetLineInCurrentGroup(void);
  27. BOOL FindTagFromCurrentPos(WCHAR *pwszTag);
  28. BOOL PositionAtLastGroup(void);
  29. BOOL PositionAtLastTag(void);
  30. BOOL AddTagToFile(WCHAR *pwszGroup, WCHAR *pwszTag, WCHAR *pwszValue);
  31. void EOLRemove(void);
  32. private:
  33. HANDLE hFile;
  34. WCHAR *pwszFName;
  35. WCHAR *pwszTempFName;
  36. WCHAR *pwszCurrentLine;
  37. WCHAR *pwszLastGroupTag;
  38. DWORD dwMaxLine;
  39. DWORD dwCurLineFilePos;
  40. DWORD dwLastGroupFilePos;
  41. DWORD dwLastTagFilePos;
  42. BOOL fEOF;
  43. };
  44. #endif // FPARSE_HXX