FileHelper.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /******************************************************************************
  2. |* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3. |* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4. |* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. |* PARTICULAR PURPOSE.
  6. |*
  7. |* Copyright 1995-2005 Nero AG. All Rights Reserved.
  8. |*-----------------------------------------------------------------------------
  9. |* PROJECT: Nero Plugin Manager Example
  10. |*
  11. |* FILE: FileHelper.h
  12. |*
  13. |* PURPOSE: Declaration of helper functions for file access
  14. ******************************************************************************/
  15. #ifndef _FILE_HELPER_
  16. # define _FILE_HELPER_
  17. #if _MSC_VER > 1000
  18. # pragma once
  19. #endif // _MSC_VER > 1000
  20. // Returns the current position in the file.
  21. DWORD GetFilePointer(HANDLE hFile);
  22. // Reads a DWORD from a file, if it's not possible throws an exception. This
  23. // allows to scan the file with multiple read without checking after every read.
  24. void ReadDWORD(void* pObject, HANDLE hFile);
  25. // Reads a WORD from a file, if it's not possible throws an exception. This
  26. // allows to scan the file with multiple read without checking after every read.
  27. void ReadWORD(void* pObject, HANDLE hFile);
  28. // Reads a DWORD from the file and aligns it to a 2-byte border since the chunk
  29. // length must be aligned to word size.
  30. DWORD ReadChunkLen(HANDLE hFile);
  31. // Writes a byte in the file.
  32. void WriteZeroByte(HANDLE hFile);
  33. #endif // _FILE_HELPER_