home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / opendc12.zip / od124os2.exe / od12osr1.exe / src / FileCtr.cpp < prev    next >
C/C++ Source or Header  |  1997-03-21  |  19KB  |  636 lines

  1. /* @(#)Z 1.15 com/src/bento/FileCtr.cpp, odstorage, od96os2, odos29712d 97/03/21 17:19:18 (96/10/29 09:12:41) */
  2. //====START_GENERATED_PROLOG======================================
  3. //
  4. //
  5. //   COMPONENT_NAME: odstorage
  6. //
  7. //   CLASSES: none
  8. //
  9. //   ORIGINS: 82,27
  10. //
  11. //
  12. //   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  13. //   All Rights Reserved
  14. //   Licensed Materials - Property of IBM
  15. //   US Government Users Restricted Rights - Use, duplication or
  16. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  17. //       
  18. //   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  19. //   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  20. //   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  21. //   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  22. //   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  23. //   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  24. //   OR PERFORMANCE OF THIS SOFTWARE.
  25. //
  26. //====END_GENERATED_PROLOG========================================
  27. //
  28.  
  29. /*
  30.     File:        FileCtr.cpp
  31.  
  32.     Contains:    Implementation of ODFileContainer class.
  33.  
  34.     Owned by:    Vincent Lo
  35.  
  36.     Copyright:    ⌐ 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  37.  
  38.     Change History (most recent first):
  39.  
  40.         <23>    10/24/95    jpa        1293441: DM/VL: Bento memory reserve &
  41.                                     fatal container err.
  42.         <22>     10/8/95    TJ        Fixes Recomended by Refball
  43.         <21>     8/24/95    EL        1276818: move Bento container suite
  44.                                     property to BentoDef.h
  45.         <20>     8/12/95    Té        1276806 Optimization: use kODFalse instead
  46.                                     of kODTrue in comparisons
  47.         <19>      8/3/95    RR        #1257260: Collapse B classes. Remove
  48.                                     somInit methods. Don't call IsInitialized
  49.                                     or SubclassResponsibility
  50.         <18>     7/21/95    VL        1270320: Create ba on stack in GetID.
  51.         <17>     5/26/95    VL        1251403: Multithreading naming support.
  52.         <16>     5/25/95    jpa        Fixed usage of ODDebug. [1253321]
  53.         <15>     4/25/95    VL        1240737: Make sure that the returned ID
  54.                                     from GetID is set to the right _length.
  55.         <14>     4/15/95    VL        1240014: Modifiy id->_length in
  56.                                     InitContainer to reflect the real length.
  57.         <13>      4/7/95    EL        1225905: Do SetModDate here rather than in
  58.                                     handler.
  59.         <12>     3/24/95    EL        1209355: open container r/w instead of
  60.                                     update because CMTakeSnapShot does not work
  61.                                     with update yet.
  62.         <11>     3/23/95    VL        1230357: Implemented Purge.
  63.         <10>      3/6/95    EL        1225905: Call RestoreModDate if file
  64.                                     container to be aborted.
  65.          <9>     2/21/95    EL        1182275: Garbage collect embedded values
  66.                                     with zero length.
  67.          <8>     2/10/95    VL        1205627: Check to see if a file is locked.
  68.                                     If so, open it read-only.
  69.          <7>    11/14/94    VL        1188257: Use Bento errors in BenotDef.h.
  70.          <6>     11/1/94    VL        1185688: Added SOM_CATCH.
  71.          <5>     9/23/94    VL        1184272: ContainerID is now a sequence of
  72.                                     octets. 1184166: Implemented GetName and
  73.                                     SetName.
  74.          <4>     8/26/94    EL        #1182275 Include code (not yet active) for
  75.                                     merging of container.
  76.          <3>      8/5/94    VL        1171603: Use somSelf->GetCMSession instead
  77.                                     of depending on ODStorageSystem.
  78.          <2>      8/3/94    VL        1153123: Storage to ODStor.
  79.          <1>     6/30/94    CC        first checked in
  80.          <0>     6/28/94    SV        SOMverted
  81.          <2>     4/13/94    VL        1157028: StorageM.h does not include
  82.                                     CMAPI.h anymore, so GetCMSession returns
  83.                                     ODULong.
  84.          <1>     3/24/94    VL        first checked in
  85.         <15>      2/8/94    VL        Use new exception macros.
  86.         <14>     1/21/94    CG        Added include for BentoCtr.h.
  87.         <13>     1/19/94    EL        Use kCMNextGeneration when opening new
  88.                                     container for update.
  89.         <12>     1/12/94    VL        Init changes.
  90.         <11>      1/6/94    EL        Reuse free space in the file.
  91.         <10>     12/3/93    Té        Stop including ODError.h, it is included
  92.                                     as ErrorDef.h inside Except.h
  93.          <9>    11/23/93    VL        Made FileContainer pool-aware.
  94.          <8>      9/9/93    VL        Moved Session Global code to ODDraft.
  95.          <7>      8/9/93    VL        Moved error code to ODError.h.
  96.          <6>      8/6/93    VL        fContainer is now fCMContainer and is
  97.                                     protected.
  98.          <5>     6/30/93    VL        Typecasted ODType to CMGlobalName for CM
  99.                                     calls.
  100.          <4>     6/22/93    VL        Used RefCount from ODRefCntObject.
  101.          <3>     6/15/93    VL        This class is now a subclass of
  102.                                     ODBentoContainer. Stripped some code and
  103.                                     put it in ODBentoContainer.
  104.          <2>      6/1/93    VL        Delete fID (PlatformFile object) in the
  105.                                     destructor. Open should SetMetaHandlers to
  106.                                     target and use CMOpenNewContainer instead
  107.                                     of CMOpenContainer.
  108.          <1>     5/27/93    VL        first checked in
  109.  
  110.     To Do:
  111.         1) Get rid of fContainer (public by convention). Maybe we can make it
  112.             private and use friends to access it.
  113.     In Progress:
  114.         
  115. */
  116.  
  117. #define ODFileContainer_Class_Source
  118.  
  119. #define VARIABLE_MACROS
  120.  
  121. #include <FileCtr.xih>
  122.  
  123. #ifndef _PLFMDEF_
  124. #include "PlfmDef.h"
  125. #endif
  126.  
  127. #ifndef _BENTODEF_
  128. #include "BentoDef.h"
  129. #endif
  130.  
  131. #ifndef SOM_ODStorageSystem_xh
  132. #include <ODStor.xh>
  133. #endif
  134.  
  135. #ifndef _FSHDR_
  136. #include "FSHdr.h"
  137. #endif
  138.  
  139. #ifndef _TARGTHDR_
  140. #include "TargtHdr.h"
  141. #endif
  142.  
  143. #ifndef _INDHDR_
  144. #include "IndHdr.h"
  145. #endif
  146.  
  147. #ifndef __CM_API__
  148. #include "CMAPI.h"
  149. #endif
  150.  
  151. #ifndef _EXCEPT_
  152. #include "Except.h"
  153. #endif
  154.  
  155. #ifndef SOM_Module_OpenDoc_Errors_defined
  156. #include "ErrorDef.xh"
  157. #endif
  158.  
  159. #ifndef _ODNEW_
  160. #include <ODNew.h>
  161. #endif
  162.  
  163. #ifndef _PLFMFILE_
  164. #include <PlfmFile.h>
  165. #endif
  166.  
  167. #ifndef _ITEXT_
  168. #include <IText.h>
  169. #endif
  170.  
  171. #ifndef _BARRAY_
  172. #include <BArray.h>
  173. #endif
  174.  
  175. #ifdef _PLATFORM_MACINTOSH
  176. #ifndef __ALIASES__
  177. #include <Aliases.h>
  178. #endif
  179. #endif
  180.  
  181. #ifdef DebugRefCount
  182. #include "Stdio.h"
  183. #endif
  184.  
  185. #if ODDebug
  186. // #define ODDebug_ODFileContainer 1
  187. #endif
  188.  
  189. #pragma segment ODFileContainer
  190.  
  191. ODBoolean IsReadOnlyFile(PlatformFile *platformFile)
  192. {
  193.         ODFileAttrFlags fileAttrs;
  194.  
  195.         // Get file attributes and return true if file is a readonly file
  196.         platformFile->GetFileAttributes(&fileAttrs);
  197.         return (fileAttrs & kODFileAttrReadOnly);
  198. }
  199.  
  200.  
  201. //==============================================================================
  202. // ODFileContainer
  203. //==============================================================================
  204.  
  205. //------------------------------------------------------------------------------
  206. // ODFileContainer: ~ODFileContainer
  207. //------------------------------------------------------------------------------
  208.  
  209. SOM_Scope void  SOMLINK ODFileContainersomUninit(ODFileContainer *somSelf)
  210. {
  211.     ODFileContainerData *somThis = ODFileContainerGetData(somSelf);
  212.     ODFileContainerMethodDebug("ODFileContainer","somUninit");
  213.  
  214. #ifdef DebugRefCount
  215.     printf("~ODFileContainer %x CMContainer %x RefCount %d\n", somSelf, _fCMContainer, _fRefCount);
  216.     fflush(stdout);
  217. #endif
  218.  
  219.         Environment *ev = somGetGlobalEnvironment ();
  220.     try
  221.         {
  222.     
  223.         if (_fCMContainer != kODNULL)
  224.             somSelf->Close(ev);
  225.     
  226.         if (_fHandlers != kODNULL)
  227.             delete _fHandlers;
  228.     
  229.         if (_fPlatformFile != kODNULL)
  230.             delete _fPlatformFile;
  231.             
  232. #ifdef _PLATFORM_MACINTOSH_
  233.         if (_fAlias != kODNULL)
  234.             ODDisposeHandle((ODHandle) _fAlias);
  235. #endif
  236.     }
  237.         catch (ODException _exception)
  238.         {
  239.         // Ignore exceptions
  240.               SetErrorCode(kODNoError);
  241.     }
  242. }
  243.  
  244. //------------------------------------------------------------------------------
  245. // ODFileContainer: InitContainer
  246. //------------------------------------------------------------------------------
  247.  
  248. SOM_Scope void  SOMLINK ODFileContainerInitContainer(ODFileContainer *somSelf, Environment *ev,
  249.         ODStorageSystem* storage, ODContainerID* id)
  250. {
  251.     ODFileContainerData *somThis = ODFileContainerGetData(somSelf);
  252.     ODFileContainerMethodDebug("ODFileContainer","InitContainer");
  253.     
  254.     _fPlatformFile = kODNULL;
  255.     _fHandlers = kODNULL;
  256.      try
  257.      {
  258.  
  259.     /* Moved from somInit. SOM itself sets fields to zero
  260.     _fCMContainer = kODNULL;
  261.     _fHandlers = kODNULL;
  262. #ifdef _PLATFORM_MACINTOSH_
  263.     _fAlias = kODNULL;
  264. #endif
  265.     _fPlatformFile = kODNULL;
  266.     */
  267.     
  268. #ifdef _PLATFORM_MACINTOSH_
  269.     OSErr err = NewAlias(kODNULL, (FSSpec*) id->_buffer, &_fAlias);
  270.     if (err != noErr)
  271.         THROW(kODErrCannotCreateContainer);
  272. #endif
  273.  
  274.     // Change id to exclude any garbage before FSSpec.name.
  275.     // struct FSSpec {
  276.     //     short                            vRefNum;
  277.     //     long                            parID;
  278.     //     Str63                            name;
  279.     // };
  280. #ifdef _PLATFORM_MACINTOSH_
  281.     id->_length = sizeof(short) + sizeof(long) + ((FSSpec*) id->_buffer)->name[0] + 1;
  282. #endif
  283.     
  284.     // Call parent with the updated id
  285.     parent_InitContainer(somSelf, ev, storage, id);
  286.     
  287.     _fPlatformFile = new PlatformFile();
  288.     _fPlatformFile->Specify((ODFileSpec*) id->_buffer);
  289.  
  290.         if (IsReadOnlyFile(_fPlatformFile))
  291.            _fPlatformFile->SetPermission(kODFileShareRead);
  292.  
  293.         
  294. #ifdef _PLATFORM_MACINTOSH_
  295.     _fHandlers = new(somSelf->GetHeap(ev)) ODFSBentoHandlers(somSelf->GetCMSession(ev),
  296.                                                             _fPlatformFile);
  297. #endif
  298. #if defined(_PLATFORM_WIN32_)||defined(_PLATFORM_OS2_)||defined(_PLATFORM_AIX_)
  299. //    The use of heap is not implemented in Windows platform
  300.     _fHandlers = new ODFSBentoHandlers(somSelf->GetCMSession(ev),
  301.                         _fPlatformFile);
  302. #endif
  303.     _fHandlers->Initialize();
  304.  
  305.     }
  306.     catch (ODException _exception)
  307.     {
  308.     if (_fHandlers != kODNULL)
  309.         delete _fHandlers;
  310.     
  311.     if (_fPlatformFile != kODNULL)
  312.         delete _fPlatformFile;
  313.         ODSetSOMException(ev, _exception);
  314.     }
  315. }
  316.  
  317. //------------------------------------------------------------------------------
  318. // ODFileContainer: GetID
  319. //------------------------------------------------------------------------------
  320.  
  321. SOM_Scope ODContainerID  SOMLINK ODFileContainerGetID(ODFileContainer *somSelf, Environment *ev)
  322. {
  323.     ODFileContainerData *somThis = ODFileContainerGetData(somSelf);
  324.     ODFileContainerMethodDebug("ODFileContainer","GetID");
  325.     
  326.     ODByteArray ba;
  327.  
  328.      try
  329.      {
  330.     
  331.     ODBoolean    dummyWasChanged;
  332.     ODFileSpec*    fsSpec = (ODFileSpec*) ODNewPtrClear(sizeof(ODFileSpec));
  333.     
  334. #ifdef _PLATFORM_MACINTOSH_
  335.     OSErr err = ResolveAlias(kODNULL, _fAlias, fsSpec, &dummyWasChanged);
  336.     if (err != noErr) {
  337.         *fsSpec = _fPlatformFile->GetFileSpec();
  338.     }
  339. #else
  340.     *fsSpec = _fPlatformFile->GetFileSpec();
  341.     
  342. #endif
  343.     ba._buffer = (octet*) fsSpec;
  344.     ba._maximum = sizeof(ODFileSpec);
  345. #ifdef _PLATFORM_MACINTOSH_
  346.     ba._length = sizeof(short) + sizeof(long) + ((FSSpec*) ba._buffer)->name[0] + 1;
  347. #else
  348.         ba._length = strlen((char *) (&(fsSpec->name[0]))) + 1;
  349. #endif
  350.     
  351.     }
  352.     catch (ODException _exception)
  353.     {
  354.         ODSetSOMException(ev, _exception);
  355.     ba._buffer = kODNULL;
  356.     ba._maximum = ba._length = 0;
  357.     }
  358.     
  359.     return ba;
  360. }
  361.  
  362. //------------------------------------------------------------------------------
  363. // ODFileContainer: GetName
  364. //------------------------------------------------------------------------------
  365.  
  366. SOM_Scope ODContainerName  SOMLINK ODFileContainerGetName(ODFileContainer *somSelf, Environment *ev)
  367. {
  368.     ODFileContainerData *somThis = ODFileContainerGetData(somSelf);
  369.     ODFileContainerMethodDebug("ODFileContainer","GetName");
  370.  
  371.     ODFileSpec            fsSpec;
  372.     ODContainerName*    name = kODNULL;
  373.     ODBoolean            dummyWasChanged;
  374.     
  375.     try
  376.     {
  377.     
  378. #ifdef _PLATFORM_MACINTOSH_
  379.     OSErr err = ResolveAlias(kODNULL, _fAlias, &fsSpec, &dummyWasChanged);
  380.     if (err != noErr) {
  381.         name = _fPlatformFile->GetName();
  382.     }
  383.     else {
  384.         name = CreateIText(0, 0, (StringPtr) &fsSpec.name);
  385.     }
  386. #else
  387.     fsSpec = _fPlatformFile->GetFileSpec();
  388.     name = CreateITextFromCharPtr((char *)&fsSpec.name);
  389. #endif
  390.     
  391.     }
  392.     catch (ODException _exception)
  393.     {
  394.          name = kODNULL;
  395.          ODSetSOMException(ev, _exception);
  396.     }
  397.     
  398.     return *name;    
  399. }
  400.  
  401. //------------------------------------------------------------------------------
  402. // ODFileContainer: SetName
  403. //------------------------------------------------------------------------------
  404.  
  405. SOM_Scope void  SOMLINK ODFileContainerSetName(ODFileContainer *somSelf, Environment *ev,
  406.         ODContainerName* name)
  407. {
  408.     ODFileContainerData *somThis = ODFileContainerGetData(somSelf);
  409.     ODFileContainerMethodDebug("ODFileContainer","SetName");
  410.  
  411.    try
  412.    {
  413.     
  414.         StringPtr fileName = GetPStringFromIText(name);
  415.        _fPlatformFile->Rename(fileName);
  416.  
  417.    }
  418.    catch (ODException _exception)
  419.    {
  420.        ODSetSOMException(ev, _exception);
  421.    }
  422.  
  423. }
  424.  
  425. //------------------------------------------------------------------------------
  426. // ODFileContainer: Create
  427. //------------------------------------------------------------------------------
  428.  
  429. SOM_Scope ODContainer*  SOMLINK ODFileContainerCreate(ODFileContainer *somSelf, Environment *ev)
  430. {
  431.     ODFileContainerData *somThis = ODFileContainerGetData(somSelf);
  432.     ODFileContainerMethodDebug("ODFileContainer","Create");
  433.  
  434.    try
  435.    {
  436.  
  437.     if (_fCMContainer == kODNULL) {
  438.     
  439.         somSelf->SetModDate(ev, _fPlatformFile->GetFileModDate());
  440.  
  441.         CMSession cmSession = somSelf->GetCMSession(ev);
  442.  
  443.         CMSetMetaHandler(cmSession,
  444.                         (CMGlobalName)CMTargetHandlersTypeName,
  445.                         targetContainerMetahandler);
  446.  
  447.         _fCMContainer = CMOpenNewContainer(cmSession,
  448.                                         _fHandlers,
  449.                                         (CMGlobalName) kODBentoFileTypeName,
  450.                                         (CMContainerUseMode) (kCMWriting),
  451.                                         1, kCMDefaultEndian);
  452.         if (_fCMContainer == kODNULL)
  453.             THROW(kODErrCannotCreateContainer);
  454.     }
  455.  
  456.  
  457.    }
  458.    catch (ODException _exception)
  459.    {
  460.         _fCMContainer = kODNULL;
  461.         ODSetSOMException(ev, _exception);
  462.    }
  463.     return somSelf;
  464. }
  465.  
  466. //------------------------------------------------------------------------------
  467. // ODFileContainer: Open
  468. //------------------------------------------------------------------------------
  469.  
  470. SOM_Scope ODContainer*  SOMLINK ODFileContainerOpen(ODFileContainer *somSelf, Environment *ev)
  471. {
  472.     ODFileContainerData *somThis = ODFileContainerGetData(somSelf);
  473.     ODFileContainerMethodDebug("ODFileContainer","Open");
  474.  
  475.     try
  476.     {
  477.  
  478.     if (_fCMContainer == kODNULL) {
  479.     
  480.         somSelf->SetModDate(ev, _fPlatformFile->GetFileModDate());
  481.  
  482.         CMSession cmSession = somSelf->GetCMSession(ev);
  483.         
  484.         CMSetMetaHandler(cmSession,
  485.                 (CMGlobalName)CMTargetHandlersTypeName,
  486.                 targetContainerMetahandler);
  487.                         
  488.                 if ((_fPlatformFile->GetPermission() == kODFileRead) || 
  489.                     (_fPlatformFile->GetPermission() == kODFileShareRead))
  490.                         _fCMContainer = CMOpenContainer(cmSession,
  491.                                         _fHandlers,
  492.                                         (CMGlobalName) kODBentoFileTypeName,
  493.                                         (CMContainerUseMode) kCMReading);
  494.                 else
  495.  
  496.         _fCMContainer = CMOpenContainer(cmSession,
  497.                 _fHandlers,
  498.                 (CMGlobalName) kODBentoFileTypeName,
  499.                 (CMContainerUseMode) kCMReuseFreeSpace);
  500.  
  501.         if (_fCMContainer == kODNULL)
  502.             THROW(kODErrCannotOpenContainer);
  503.     }
  504.  
  505.  
  506.     }
  507.     catch (ODException _exception)
  508.     {  
  509.        _fCMContainer = kODNULL;
  510.        ODSetSOMException(ev, _exception);
  511.     }
  512.     return somSelf;
  513. }
  514.  
  515. //------------------------------------------------------------------------------
  516. // ODFileContainer: Close
  517. //------------------------------------------------------------------------------
  518.  
  519. SOM_Scope ODContainer*  SOMLINK ODFileContainerClose(ODFileContainer *somSelf, Environment *ev)
  520. {
  521.     ODFileContainerData *somThis = ODFileContainerGetData(somSelf);
  522.     ODFileContainerMethodDebug("ODFileContainer","Close");
  523.  
  524.     try
  525.     {
  526.  
  527.     if (_fCMContainer != kODNULL) {
  528.         try
  529.                 {
  530.             if (somSelf->GetDirtyFlag(ev) != kODFalse) {
  531.                 CMObject    currObj, nextObj;
  532.                 CMProperty    embedProp;
  533.                 CMType        embedType;
  534.                 CMValue        currValue;
  535.                 CMSize        valueSize;
  536.     
  537.                 embedProp = CMRegisterProperty(_fCMContainer, kODPropVersionList);
  538.                 currObj = CMGetNextObjectWithProperty(_fCMContainer, kODNULL, embedProp);
  539.                 CMKeepObject(currObj);
  540.                 embedProp = CMRegisterProperty(_fCMContainer, kODEmbeddedContainerProperty); // "OpenDoc:EmbeddedContainer"
  541.                 embedType = CMRegisterType(_fCMContainer, kODEmbeddedContainerType); // "OpenDoc:EmbeddedContainerType"
  542.                 currObj = CMGetNextObjectWithProperty(_fCMContainer, kODNULL, embedProp);
  543.                 while (currObj) {
  544.                     nextObj = CMGetNextObjectWithProperty(_fCMContainer, currObj, embedProp);
  545.                     currValue = CMUseValue(currObj, embedProp, embedType);
  546.                     if (currValue) {
  547.                         valueSize =  CMGetValueSize(currValue);
  548.                         CMReleaseValue(currValue);
  549.                         if (valueSize)    /* no need to keep it unless length is not zero */
  550.                             CMKeepObject(currObj);
  551.                     } 
  552.                     currObj = nextObj;
  553.                 };
  554.                 CMCloseContainer(_fCMContainer);
  555. #if ODDebug_ODFileContainer
  556. somPrintf("FileContainer Close: Close\n");
  557. #endif
  558.             }
  559.             else {
  560.                 CMAbortContainer(_fCMContainer);
  561. #if ODDebug_ODFileContainer
  562. somPrintf("FileContainer Close: Abort\n");
  563. #endif
  564.             }
  565.                         if ((_fPlatformFile->GetPermission() != kODFileRead) && 
  566.                             (_fPlatformFile->GetPermission() != kODFileShareRead))
  567.                     _fPlatformFile->SetFileModDate(somSelf->GetModDate(ev));
  568.                 }
  569.         catch(ODException _exception)
  570.                 {
  571.             if (ErrorCode() == kODErrBentoErr)
  572.                 SetErrorCode(kODErrFatalContainerError);
  573.                         ODSetSOMException(ev, _exception);
  574.         }
  575.         _fCMContainer = kODNULL;
  576.     }
  577.     
  578.  
  579.     }
  580.     catch (ODException _exception)
  581.     {
  582.          ODSetSOMException(ev, _exception);
  583.     }
  584.     return ODFileContainer_parent_ODBentoContainer_Close(somSelf, ev);
  585. }
  586.  
  587. //------------------------------------------------------------------------------
  588. // ODFileContainer: Purge
  589. //------------------------------------------------------------------------------
  590.  
  591. SOM_Scope ODSize  SOMLINK ODFileContainerPurge(ODFileContainer *somSelf, Environment *ev,
  592.         ODSize size)
  593. {
  594.     ODFileContainerData *somThis = ODFileContainerGetData(somSelf);
  595.     ODFileContainerMethodDebug("ODFileContainer","Purge");
  596.  
  597.         ODSize odsize = 0;
  598.     
  599.     try
  600.     {
  601.     odsize = parent_Purge(somSelf, ev, size);
  602.  
  603.     }
  604.     catch (ODException _exception)
  605.     {
  606.         odsize = 0;
  607.         ODSetSOMException(ev, _exception);
  608.     }
  609.         return odsize;
  610. }
  611.  
  612. //------------------------------------------------------------------------------
  613. // ODFileContainer: GetCMContainer
  614. //------------------------------------------------------------------------------
  615.  
  616. SOM_Scope CMContainer  SOMLINK ODFileContainerGetCMContainer(ODFileContainer *somSelf, Environment *ev)
  617. {
  618.     ODFileContainerData *somThis = ODFileContainerGetData(somSelf);
  619.     ODFileContainerMethodDebug("ODFileContainer","GetCMContainer");
  620.  
  621.     return _fCMContainer;
  622. }
  623.  
  624. //------------------------------------------------------------------------------
  625. // ODFileContainer: GetHandlers
  626. //------------------------------------------------------------------------------
  627.  
  628. SOM_Scope ODBentoHandlers*  SOMLINK ODFileContainerGetHandlers(ODFileContainer *somSelf, Environment *ev)
  629. {
  630.     ODFileContainerData *somThis = ODFileContainerGetData(somSelf);
  631.     ODFileContainerMethodDebug("ODFileContainer","GetHandlers");
  632.  
  633.     return _fHandlers;
  634. }
  635.  
  636.