home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWFiles / Sources / FWFilRep.cpp < prev    next >
Encoding:
Text File  |  1996-08-16  |  2.8 KB  |  105 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWFilRep.cpp
  4. //    Release Version:    $ ODF 1 $
  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_INTANTIATION
  42. template class FW_TCountedSOMPtr<FW_OFile>;
  43. #endif
  44.  
  45. #if defined(__MWERKS__) && GENERATING68K
  46. // A hack to work around a bug
  47. #pragma import list somNewObjectInstance
  48. #endif
  49.  
  50. //========================================================================================
  51. // CLASS FW_PFile
  52. //========================================================================================
  53.  
  54. //----------------------------------------------------------------------------------------
  55. // FW_PFile::FW_PFile
  56. //----------------------------------------------------------------------------------------
  57.  
  58. FW_PFile::FW_PFile(Environment* ev, FW_OFile* privFileAccessRep)
  59. {
  60.     SetRep(ev, privFileAccessRep);
  61. }
  62.  
  63. //----------------------------------------------------------------------------------------
  64. // FW_PFile::FW_PFile
  65. //----------------------------------------------------------------------------------------
  66.  
  67. FW_PFile::FW_PFile(Environment* ev, 
  68.                    FW_OFileSpecification* fileSpecification,
  69.                    FW_Boolean allowCreate)
  70. {
  71.     FW_OFile* rep = new FW_OFile();
  72.  
  73.     SetRep(ev, rep);
  74.     rep->InitWithExclusiveAccess(ev,
  75.                                  fileSpecification, 
  76.                                  allowCreate);
  77. }
  78.  
  79. //----------------------------------------------------------------------------------------
  80. // FW_PFile::FW_PFile
  81. //----------------------------------------------------------------------------------------
  82.  
  83. FW_PFile::FW_PFile(Environment* ev, 
  84.                    FW_OFileSpecification* fileSpecification,
  85.                    const FW_SAccessPermission& permission,
  86.                    FW_Boolean allowCreate)
  87. {
  88.     FW_OFile* rep = new FW_OFile();
  89.  
  90.     SetRep(ev, rep);
  91.     rep->InitWithPermissions(ev,
  92.                              fileSpecification, 
  93.                              (FW_SAccessPermission *) &permission, 
  94.                              allowCreate);
  95. }
  96.  
  97. //----------------------------------------------------------------------------------------
  98. // FW_PFile::~FW_PFile
  99. //----------------------------------------------------------------------------------------
  100.  
  101. FW_PFile::~FW_PFile()
  102. {
  103. }
  104.  
  105.