home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWFiles / SLFileAc.cpp < prev    next >
Encoding:
Text File  |  1996-09-17  |  5.6 KB  |  222 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                SLFileAc.cpp
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #include "FWOS.hpp"
  11.  
  12. #include <Limits.h>
  13.  
  14. #ifndef FWEXCDEF_H
  15. #include "FWExcDef.h"
  16. #endif
  17.  
  18. #ifndef SLFILESY_H
  19. #include "SLFileSy.h"
  20. #endif
  21.  
  22. #include "SLFileSp.xh"
  23.  
  24. #ifndef FWACCBUF_H
  25. //#include "FWAccBuf.h"
  26. #endif
  27.  
  28. #include "SLFilRep.xh"
  29.  
  30. #ifndef FWPRIDEB_H
  31. #include "FWPriDeb.h"
  32. #endif
  33.  
  34. #ifdef FW_BUILD_MAC
  35. #pragma segment File
  36. #endif
  37.  
  38.  
  39. /*
  40.  *  This file was generated by the SOM Compiler.
  41.  *  Generated using: 
  42.  *      SOM Emitter emitxtm.dll: 2.33
  43.  */
  44.  
  45. #define FW_OFileSink_Class_Source
  46. #include "SLFileAc.xih"
  47.  
  48.  
  49.  
  50. //----------------------------------------------------------------------------------------
  51. // FW_OFileSink__Init
  52. //----------------------------------------------------------------------------------------
  53.  
  54. SOM_Scope void  SOMLINK FW_OFileSink__InitFromOFile(FW_OFileSink *somSelf, Environment *ev,
  55.         FW_OFile* theFile)
  56. {
  57. FW_UNUSED(ev);
  58.     FW_OFileSinkData *somThis = FW_OFileSinkGetData(somSelf);
  59.  
  60.     somThis->fRep = theFile;
  61. }
  62.  
  63.  
  64. //----------------------------------------------------------------------------------------
  65. // FW_OFileSink__GetOFile
  66. //----------------------------------------------------------------------------------------
  67.  
  68. SOM_Scope FW_OFile*  SOMLINK FW_OFileSink__GetOFileRep(FW_OFileSink *somSelf, Environment *ev)
  69. {
  70. FW_UNUSED(ev);
  71.     FW_OFileSinkData *somThis = FW_OFileSinkGetData(somSelf);
  72.  
  73.     return somThis->fRep;
  74. }
  75.  
  76.  
  77. //----------------------------------------------------------------------------------------
  78. // FW_OFileSink__somInit
  79. //----------------------------------------------------------------------------------------
  80.  
  81. SOM_Scope void  SOMLINK FW_OFileSink__somInit(FW_OFileSink *somSelf)
  82. {
  83. FW_UNUSED(somSelf);
  84.  
  85. //    FW_OFileSinkData *somThis = FW_OFileSinkGetData(somSelf);
  86.  
  87. //    FW_OFileSink_parent_FW_ORandomAccessSink_somInit(somSelf);
  88. }
  89.  
  90.  
  91. //----------------------------------------------------------------------------------------
  92. // FW_OFileSink__somUninit
  93. //----------------------------------------------------------------------------------------
  94.  
  95. SOM_Scope void  SOMLINK FW_OFileSink__somUninit(FW_OFileSink *somSelf)
  96. {
  97. FW_UNUSED(somSelf);
  98.  
  99. //    FW_OFileSinkData *somThis = FW_OFileSinkGetData(somSelf);
  100.  
  101. //    FW_OFileSink_parent_FW_ORandomAccessSink_somUninit(somSelf);
  102. }
  103.  
  104.  
  105. //----------------------------------------------------------------------------------------
  106. // FW_OFileSink__Read
  107. //----------------------------------------------------------------------------------------
  108.  
  109. SOM_Scope void  SOMLINK FW_OFileSink__Read(FW_OFileSink *somSelf, Environment *ev,
  110.         void* destination,
  111.         long count)
  112. {
  113.     FW_OFileSinkData *somThis = FW_OFileSinkGetData(somSelf);
  114.  
  115.     FW_SOM_TRY
  116.     {
  117.         somThis->fRep->Read(ev, destination, count);
  118.     }
  119.     FW_SOM_CATCH
  120. }
  121.  
  122.  
  123. //----------------------------------------------------------------------------------------
  124. // FW_OFileSink__GetWritableBytes
  125. //----------------------------------------------------------------------------------------
  126.  
  127. SOM_Scope long  SOMLINK FW_OFileSink__GetWritableBytes(FW_OFileSink *somSelf, Environment *ev)
  128. {
  129. FW_UNUSED(ev);
  130.     FW_OFileSinkData *somThis = FW_OFileSinkGetData(somSelf);
  131.  
  132.     return LONG_MAX;
  133. }
  134.  
  135.  
  136. //----------------------------------------------------------------------------------------
  137. // FW_OFileSink__Write
  138. //----------------------------------------------------------------------------------------
  139.  
  140. SOM_Scope void  SOMLINK FW_OFileSink__Write(FW_OFileSink *somSelf, Environment *ev,
  141.         void* source,
  142.         long count)
  143. {
  144.     FW_OFileSinkData *somThis = FW_OFileSinkGetData(somSelf);
  145.  
  146.     FW_SOM_TRY
  147.     {
  148.         somThis->fRep->Write(ev, (void *) source, count);
  149.     }
  150.     FW_SOM_CATCH
  151. }
  152.  
  153.  
  154. //----------------------------------------------------------------------------------------
  155. // FW_OFileSink__GetLength
  156. //----------------------------------------------------------------------------------------
  157.  
  158. SOM_Scope long  SOMLINK FW_OFileSink__GetLength(FW_OFileSink *somSelf, Environment *ev)
  159. {
  160.     FW_OFileSinkData *somThis = FW_OFileSinkGetData(somSelf);
  161.  
  162.     FW_SOM_TRY
  163.     {
  164.         return somThis->fRep->GetLength(ev);
  165.     }
  166.     FW_SOM_CATCH
  167.     return 0;
  168. }
  169.  
  170.  
  171. //----------------------------------------------------------------------------------------
  172. // FW_OFileSink__SetLength
  173. //----------------------------------------------------------------------------------------
  174.  
  175. SOM_Scope void  SOMLINK FW_OFileSink__SetLength(FW_OFileSink *somSelf, Environment *ev,
  176.         long length)
  177. {
  178.     FW_OFileSinkData *somThis = FW_OFileSinkGetData(somSelf);
  179.  
  180.     FW_SOM_TRY
  181.     {
  182.         somThis->fRep->SetLength(ev, length);
  183.     }
  184.     FW_SOM_CATCH
  185. }
  186.  
  187.  
  188. //----------------------------------------------------------------------------------------
  189. // FW_OFileSink__GetPosition
  190. //----------------------------------------------------------------------------------------
  191.  
  192. SOM_Scope long  SOMLINK FW_OFileSink__GetPosition(FW_OFileSink *somSelf, Environment *ev)
  193. {
  194.     FW_OFileSinkData *somThis = FW_OFileSinkGetData(somSelf);
  195.  
  196.     FW_SOM_TRY
  197.     {
  198.         return somThis->fRep->GetPosition(ev);
  199.     }
  200.     FW_SOM_CATCH
  201.     return 0;
  202. }
  203.  
  204.  
  205. //----------------------------------------------------------------------------------------
  206. // FW_OFileSink__SetPosition
  207. //----------------------------------------------------------------------------------------
  208.  
  209. SOM_Scope void  SOMLINK FW_OFileSink__SetPosition(FW_OFileSink *somSelf, Environment *ev,
  210.         long position)
  211. {
  212.     FW_OFileSinkData *somThis = FW_OFileSinkGetData(somSelf);
  213.  
  214.     FW_SOM_TRY
  215.     {
  216.         somThis->fRep->SetPosition(ev, FW_kFromStart, position);
  217.     }
  218.     FW_SOM_CATCH
  219. }
  220.  
  221.  
  222.