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 / FWFilRep.cpp < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.7 KB  |  100 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWFilRep.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. #ifndef FWFILREP_H
  13. #include "FWFilRep.h"
  14. #endif
  15.  
  16. #ifndef FWPRIDEB_H
  17. #include "FWPriDeb.h"
  18. #endif
  19.  
  20. #ifndef FWEXCDEF_H
  21. #include "FWExcDef.h"
  22. #endif
  23.  
  24. #ifdef FW_BUILD_MAC
  25. #pragma segment File
  26. #endif
  27.  
  28. //========================================================================================
  29. //    Template instantiation
  30. //========================================================================================
  31.  
  32. #include "FWSOMPtr.tpp"
  33.  
  34. FW_DEFINE_AUTO_TEMPLATE(FW_TCountedSOMPtr, FW_OFile)
  35.  
  36. #if FW_USE_TEMPLATE_PRAGMAS
  37. #pragma template_access public
  38. #pragma template FW_TCountedSOMPtr<FW_OFile>
  39. #endif
  40.  
  41. #if FW_ANSI_TEMPLATE_INSTANTIATION
  42. template class FW_TCountedSOMPtr<FW_OFile>;
  43. #endif
  44.  
  45. //========================================================================================
  46. // CLASS FW_PFile
  47. //========================================================================================
  48.  
  49. //----------------------------------------------------------------------------------------
  50. // FW_PFile::FW_PFile
  51. //----------------------------------------------------------------------------------------
  52.  
  53. FW_PFile::FW_PFile(Environment* ev, FW_OFile* privFileAccessRep)
  54. {
  55.     SetRep(ev, privFileAccessRep);
  56. }
  57.  
  58. //----------------------------------------------------------------------------------------
  59. // FW_PFile::FW_PFile
  60. //----------------------------------------------------------------------------------------
  61.  
  62. FW_PFile::FW_PFile(Environment* ev, 
  63.                    FW_OFileSpecification* fileSpecification,
  64.                    FW_Boolean allowCreate)
  65. {
  66.     FW_OFile* rep = new FW_OFile();
  67.  
  68.     SetRep(ev, rep);
  69.     rep->InitWithExclusiveAccess(ev,
  70.                                  fileSpecification, 
  71.                                  allowCreate);
  72. }
  73.  
  74. //----------------------------------------------------------------------------------------
  75. // FW_PFile::FW_PFile
  76. //----------------------------------------------------------------------------------------
  77.  
  78. FW_PFile::FW_PFile(Environment* ev, 
  79.                    FW_OFileSpecification* fileSpecification,
  80.                    const FW_SAccessPermission& permission,
  81.                    FW_Boolean allowCreate)
  82. {
  83.     FW_OFile* rep = new FW_OFile();
  84.  
  85.     SetRep(ev, rep);
  86.     rep->InitWithPermissions(ev,
  87.                              fileSpecification, 
  88.                              (FW_SAccessPermission *) &permission, 
  89.                              allowCreate);
  90. }
  91.  
  92. //----------------------------------------------------------------------------------------
  93. // FW_PFile::~FW_PFile
  94. //----------------------------------------------------------------------------------------
  95.  
  96. FW_PFile::~FW_PFile()
  97. {
  98. }
  99.  
  100.