home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Found / FWStream / Sources / FWSUStrm.cpp < prev    next >
Encoding:
Text File  |  1994-04-21  |  4.4 KB  |  134 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWSUStrm.cpp
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Creation Date:        4/12/94
  7. //
  8. //    Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef FWSUSTRM_H
  13. #include "FWSUStrm.h"
  14. #endif
  15.  
  16. #ifndef FWSTDDEF_H
  17. #include "FWStdDef.h"
  18. #endif
  19.  
  20. //========================================================================================
  21. //    •• CLASS FW_CStorageUnitSink
  22. //========================================================================================
  23.  
  24. //----------------------------------------------------------------------------------------
  25. //    • FW_CStorageUnitSink::FW_CStorageUnitSink
  26. //----------------------------------------------------------------------------------------
  27.  
  28. FW_CStorageUnitSink::FW_CStorageUnitSink(XMPStorageUnit* storageUnit) :
  29.     fStorageUnit(storageUnit)
  30. {
  31. }
  32.  
  33. //----------------------------------------------------------------------------------------
  34. //    • FW_CStorageUnitSink::~FW_CStorageUnitSink
  35. //----------------------------------------------------------------------------------------
  36.  
  37. FW_CStorageUnitSink::~FW_CStorageUnitSink()
  38. {
  39. }
  40.  
  41. //----------------------------------------------------------------------------------------
  42. //    • FW_CStorageUnitSink::Read
  43. //----------------------------------------------------------------------------------------
  44.  
  45. void FW_CStorageUnitSink::Read(void * destination, long count)
  46. {
  47.     fStorageUnit->GetValue(count, (XMPValue)destination);
  48. }
  49.  
  50. //----------------------------------------------------------------------------------------
  51. //    • FW_CStorageUnitSink::ReadPeekAdvance
  52. //----------------------------------------------------------------------------------------
  53.  
  54. void FW_CStorageUnitSink::ReadPeekAdvance(long bytesRead)
  55. {
  56.     fStorageUnit->SetOffset(fStorageUnit->GetOffset() + bytesRead);
  57. }
  58.     
  59. //----------------------------------------------------------------------------------------
  60. //    • FW_CStorageUnitSink::GetWritableBytes
  61. //----------------------------------------------------------------------------------------
  62.  
  63. long FW_CStorageUnitSink::GetWritableBytes() const
  64. {
  65.     return 0x7FFFFFF;
  66. }
  67.  
  68. //----------------------------------------------------------------------------------------
  69. //    • FW_CStorageUnitSink::Write
  70. //----------------------------------------------------------------------------------------
  71.  
  72. void FW_CStorageUnitSink::Write(const void* source, long count)
  73. {
  74.     fStorageUnit->SetValue(count, (XMPValue)source);
  75. }
  76.  
  77. //----------------------------------------------------------------------------------------
  78. //    • FW_CStorageUnitSink::WritePeekAdvance
  79. //----------------------------------------------------------------------------------------
  80.  
  81. void FW_CStorageUnitSink::WritePeekAdvance(long bytesWritten)
  82. {
  83.     fStorageUnit->SetOffset(fStorageUnit->GetOffset() + bytesWritten);
  84. }
  85.  
  86. //----------------------------------------------------------------------------------------
  87. // FW_CStorageUnitSink::GetLength
  88. //----------------------------------------------------------------------------------------
  89.  
  90. long FW_CStorageUnitSink::GetLength() const
  91. {
  92.     return fStorageUnit->GetSize();
  93. }
  94.  
  95. //----------------------------------------------------------------------------------------
  96. // FW_CStorageUnitSink::GetPosition
  97. //----------------------------------------------------------------------------------------
  98.  
  99. long FW_CStorageUnitSink::GetPosition() const
  100. {
  101.     return fStorageUnit->GetOffset();
  102. }
  103.  
  104. //----------------------------------------------------------------------------------------
  105. // FW_CStorageUnitSink::SetPosition
  106. //----------------------------------------------------------------------------------------
  107.  
  108. void FW_CStorageUnitSink::SetPosition(long position)
  109. {
  110.     fStorageUnit->SetOffset(position);
  111. }
  112.  
  113. //----------------------------------------------------------------------------------------
  114. // FW_CStorageUnitSink::ReadPeek
  115. //----------------------------------------------------------------------------------------
  116.  
  117. const void* FW_CStorageUnitSink::ReadPeek(long& availableReadBytes)
  118. {
  119. FW_UNUSED(availableReadBytes);
  120.     
  121.     return NULL;
  122. }
  123.  
  124. //----------------------------------------------------------------------------------------
  125. // FW_CStorageUnitSink::WritePeek
  126. //----------------------------------------------------------------------------------------
  127.  
  128. void* FW_CStorageUnitSink::WritePeek(long& availableWriteBytes)
  129. {
  130. FW_UNUSED(availableWriteBytes);
  131.     
  132.     return NULL;
  133. }
  134.