FileSystemBlockWriterInterface.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. |* NeroSDK / NeroAPI
  10. |*
  11. |* PROGRAM: FileSystemBlockWriterInterface.h
  12. |*
  13. |* PURPOSE: The FileSystem block writer interface is derived from the block
  14. |* reader interface. It defines a path of access to RW filesystems
  15. |* and partitions.
  16. ******************************************************************************/
  17. #ifndef FILESYSTEMBLOCKWRITERINTERFACE_H
  18. #define FILESYSTEMBLOCKWRITERINTERFACE_H
  19. #include "FileSystemBlockReaderInterface.h"
  20. #if defined(__BORLANDC__)
  21. // NEROAPI expects structs to be 8byte aligned
  22. #pragma pack(push, 8)
  23. // tell Borland C++ Builder to treat enums as int
  24. #pragma option push -b
  25. #endif
  26. // Specifies the block writer type.
  27. // You can use this information to down-cast the interface to obtain specialized functionality...
  28. // No extensions to the normal blockwrite interface are available so far...
  29. enum InterfaceType
  30. {
  31. eBWIUnknown
  32. };
  33. class INeroFileSystemBlockWriter
  34. :public INeroFileSystemBlockReader
  35. {
  36. public:
  37. // As is the case with the reader interface, the writer interface also provides two methods for sector
  38. // access. While WriteSectorsUnBuffered will merely ensure the consistency of the read cache (write thru),
  39. // WriteSectorsBuffered will not write anything to the block device immediately but will cache
  40. // a certain amount of sectors before doing so.
  41. // The latter increases performance considerably but is prone to data loss in an unstable environment.
  42. // Please note that regardless of which method you use, you *must* call FlushSectorCache() if you want
  43. // all your data to be at their final physical location because even when writing in UnBuffered mode,
  44. // the driver may decide to not write away your data immediately, depending on the underlying
  45. // writing scheme (e.g. packet writing will always try to collect a certain amount of sectors)
  46. virtual NeroFSError WriteSectorsBuffered (const void *pData, NeroFSSecNo startSector, NeroFSSecNo noSectors, NeroFSSecNo &noSectorsWritten) = 0;
  47. virtual NeroFSError WriteSectorsUnBuffered(const void *pData, NeroFSSecNo startSector, NeroFSSecNo noSectors, NeroFSSecNo &noSectorsWritten) = 0;
  48. // FlushSectorCache will be performed implicitly upon deleting the block writer object
  49. virtual void FlushSectorCache() = 0;
  50. // Runtime type information to be used for downcasting into specialized interfaces...
  51. virtual InterfaceType GetBlockWriterType() = 0;
  52. };
  53. #if defined(__BORLANDC__)
  54. #pragma pack(pop)
  55. #pragma option pop
  56. #endif
  57. #endif // FILESYSTEMBLOCKWRITERINTERFACE_H