Back to index

lightning-sunbird  0.9+nobinonly
morkFactory.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-  */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1999
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #ifndef _MDB_
00039 #include "mdb.h"
00040 #endif
00041 
00042 #ifndef _MORK_
00043 #include "mork.h"
00044 #endif
00045 
00046 #ifndef _MORKNODE_
00047 #include "morkNode.h"
00048 #endif
00049 
00050 #ifndef _MORKOBJECT_
00051 #include "morkObject.h"
00052 #endif
00053 
00054 #ifndef _MORKENV_
00055 #include "morkEnv.h"
00056 #endif
00057 
00058 #ifndef _MORKFACTORY_
00059 #include "morkFactory.h"
00060 #endif
00061 
00062 #ifndef _ORKINHEAP_
00063 #include "orkinHeap.h"
00064 #endif
00065 
00066 #ifndef _MORKFILE_
00067 #include "morkFile.h"
00068 #endif
00069 
00070 #ifndef _MORKSTORE_
00071 #include "morkStore.h"
00072 #endif
00073 
00074 #ifndef _MORKTHUMB_
00075 #include "morkThumb.h"
00076 #endif
00077 
00078 #ifndef _MORKWRITER_
00079 #include "morkWriter.h"
00080 #endif
00081 //3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
00082 
00083 // ````` ````` ````` ````` ````` 
00084 // { ===== begin morkNode interface =====
00085 
00086 /*public virtual*/ void
00087 morkFactory::CloseMorkNode(morkEnv* ev) /*i*/ // CloseFactory() only if open
00088 {
00089   if ( this->IsOpenNode() )
00090   {
00091     this->MarkClosing();
00092     this->CloseFactory(ev);
00093     this->MarkShut();
00094   }
00095 }
00096 
00097 /*public virtual*/
00098 morkFactory::~morkFactory() /*i*/ // assert CloseFactory() executed earlier
00099 {
00100   CloseFactory(&mFactory_Env);
00101   MORK_ASSERT(mFactory_Env.IsShutNode());
00102   MORK_ASSERT(this->IsShutNode());
00103 }
00104 
00105 /*public non-poly*/
00106 morkFactory::morkFactory() // uses orkinHeap
00107 : morkObject(morkUsage::kGlobal, (nsIMdbHeap*) 0, morkColor_kNone)
00108 , mFactory_Env(morkUsage::kMember, (nsIMdbHeap*) 0, this,
00109   new orkinHeap())
00110 , mFactory_Heap()
00111 {
00112   if ( mFactory_Env.Good() )
00113   {
00114     mNode_Derived = morkDerived_kFactory;
00115     mNode_Refs += morkFactory_kWeakRefCountBonus;
00116   }
00117 }
00118 
00119 /*public non-poly*/
00120 morkFactory::morkFactory(nsIMdbHeap* ioHeap)
00121 : morkObject(morkUsage::kHeap, ioHeap, morkColor_kNone)
00122 , mFactory_Env(morkUsage::kMember, (nsIMdbHeap*) 0, this, ioHeap)
00123 , mFactory_Heap()
00124 {
00125   if ( mFactory_Env.Good() )
00126   {
00127     mNode_Derived = morkDerived_kFactory;
00128     mNode_Refs += morkFactory_kWeakRefCountBonus;
00129   }
00130 }
00131 
00132 /*public non-poly*/
00133 morkFactory::morkFactory(morkEnv* ev, /*i*/
00134   const morkUsage& inUsage, nsIMdbHeap* ioHeap)
00135 : morkObject(ev, inUsage, ioHeap, morkColor_kNone, (morkHandle*) 0)
00136 , mFactory_Env(morkUsage::kMember, (nsIMdbHeap*) 0, this, ioHeap)
00137 , mFactory_Heap()
00138 {
00139   if ( ev->Good() )
00140   {
00141     mNode_Derived = morkDerived_kFactory;
00142     mNode_Refs += morkFactory_kWeakRefCountBonus;
00143   }
00144 }
00145 
00146 NS_IMPL_ISUPPORTS_INHERITED1(morkFactory, morkObject, nsIMdbFactory)
00147 
00148 extern "C" nsIMdbFactory* MakeMdbFactory() 
00149 {
00150   return new morkFactory(new orkinHeap());
00151 }
00152 
00153 
00154 /*public non-poly*/ void
00155 morkFactory::CloseFactory(morkEnv* ev) /*i*/ // called by CloseMorkNode();
00156 {
00157   if ( this )
00158   {
00159     if ( this->IsNode() )
00160     {
00161       mFactory_Env.CloseMorkNode(ev);
00162       this->CloseObject(ev);
00163       this->MarkShut();
00164     }
00165     else
00166       this->NonNodeError(ev);
00167   }
00168   else
00169     ev->NilPointerError();
00170 }
00171 
00172 // } ===== end morkNode methods =====
00173 // ````` ````` ````` ````` ````` 
00174 
00175 morkEnv* morkFactory::GetInternalFactoryEnv(mdb_err* outErr)
00176 {
00177   morkEnv* outEnv = 0;
00178   if (IsNode() && IsOpenNode() && IsFactory() )
00179   {
00180     morkEnv* fenv = &mFactory_Env;
00181     if ( fenv && fenv->IsNode() && fenv->IsOpenNode() && fenv->IsEnv() )
00182     {
00183       fenv->ClearMorkErrorsAndWarnings(); // drop any earlier errors
00184       outEnv = fenv;
00185     }
00186     else
00187       *outErr = morkEnv_kBadFactoryEnvError;
00188   }
00189   else
00190     *outErr = morkEnv_kBadFactoryError;
00191     
00192   return outEnv;
00193 }
00194 
00195 
00196 void
00197 morkFactory::NonFactoryTypeError(morkEnv* ev)
00198 {
00199   ev->NewError("non morkFactory");
00200 }
00201 
00202 
00203 NS_IMETHODIMP
00204 morkFactory::OpenOldFile(nsIMdbEnv* mev, nsIMdbHeap* ioHeap,
00205   const char* inFilePath,
00206   mork_bool inFrozen, nsIMdbFile** acqFile)
00207   // Choose some subclass of nsIMdbFile to instantiate, in order to read
00208   // (and write if not frozen) the file known by inFilePath.  The file
00209   // returned should be open and ready for use, and presumably positioned
00210   // at the first byte position of the file.  The exact manner in which
00211   // files must be opened is considered a subclass specific detail, and
00212   // other portions or Mork source code don't want to know how it's done.
00213 {
00214   mdb_err outErr = 0;
00215   morkEnv* ev = morkEnv::FromMdbEnv(mev);
00216   morkFile* file = nsnull;
00217   if ( ev )
00218   {
00219     if ( !ioHeap )
00220       ioHeap = &mFactory_Heap;
00221       
00222     file = morkFile::OpenOldFile(ev, ioHeap, inFilePath, inFrozen);
00223     NS_IF_ADDREF( file );
00224       
00225     outErr = ev->AsErr();
00226   }
00227   if ( acqFile )
00228     *acqFile = file;
00229     
00230   return outErr;
00231 }
00232 
00233 NS_IMETHODIMP
00234 morkFactory::CreateNewFile(nsIMdbEnv* mev, nsIMdbHeap* ioHeap,
00235   const char* inFilePath, nsIMdbFile** acqFile)
00236   // Choose some subclass of nsIMdbFile to instantiate, in order to read
00237   // (and write if not frozen) the file known by inFilePath.  The file
00238   // returned should be created and ready for use, and presumably positioned
00239   // at the first byte position of the file.  The exact manner in which
00240   // files must be opened is considered a subclass specific detail, and
00241   // other portions or Mork source code don't want to know how it's done.
00242 {
00243   mdb_err outErr = 0;
00244   morkEnv* ev = morkEnv::FromMdbEnv(mev);
00245   morkFile* file = nsnull;
00246   if ( ev )
00247   {
00248     if ( !ioHeap )
00249       ioHeap = &mFactory_Heap;
00250       
00251     file = morkFile::CreateNewFile(ev, ioHeap, inFilePath);
00252     if ( file )
00253       NS_ADDREF(file);
00254       
00255     outErr = ev->AsErr();
00256   }
00257   if ( acqFile )
00258     *acqFile = file;
00259     
00260   return outErr;
00261 }
00262 // } ----- end file methods -----
00263 
00264 // { ----- begin env methods -----
00265 NS_IMETHODIMP
00266 morkFactory::MakeEnv(nsIMdbHeap* ioHeap, nsIMdbEnv** acqEnv)
00267 // ioHeap can be nil, causing a MakeHeap() style heap instance to be used
00268 {
00269   mdb_err outErr = 0;
00270   nsIMdbEnv* outEnv = 0;
00271   mork_bool ownsHeap = (ioHeap == 0);
00272   if ( !ioHeap )
00273     ioHeap = new orkinHeap();
00274 
00275   if ( acqEnv && ioHeap )
00276   {
00277     morkEnv* fenv = this->GetInternalFactoryEnv(&outErr);
00278     if ( fenv )
00279     {
00280       morkEnv* newEnv = new(*ioHeap, fenv)
00281         morkEnv(morkUsage::kHeap, ioHeap, this, ioHeap);
00282 
00283       if ( newEnv )
00284       {
00285         newEnv->mEnv_OwnsHeap = ownsHeap;
00286         newEnv->mNode_Refs += morkEnv_kWeakRefCountEnvBonus;
00287         NS_ADDREF(newEnv);
00288         newEnv->mEnv_SelfAsMdbEnv = newEnv;
00289         outEnv = newEnv;
00290       }
00291       else
00292         outErr = morkEnv_kOutOfMemoryError;
00293     }
00294     
00295     *acqEnv = outEnv;
00296   }
00297   else
00298     outErr = morkEnv_kNilPointerError;
00299     
00300   return outErr;
00301 }
00302 // } ----- end env methods -----
00303 
00304 // { ----- begin heap methods -----
00305 NS_IMETHODIMP
00306 morkFactory::MakeHeap(nsIMdbEnv* mev, nsIMdbHeap** acqHeap)
00307 {
00308   mdb_err outErr = 0;
00309   nsIMdbHeap* outHeap = 0;
00310   morkEnv* ev = morkEnv::FromMdbEnv(mev);
00311   if ( ev )
00312   {
00313     outHeap = new orkinHeap();
00314     if ( !outHeap )
00315       ev->OutOfMemoryError();
00316   }
00317   MORK_ASSERT(acqHeap);
00318   if ( acqHeap )
00319     *acqHeap = outHeap;
00320   return outErr;
00321 }
00322 // } ----- end heap methods -----
00323 
00324 // { ----- begin compare methods -----
00325 NS_IMETHODIMP
00326 morkFactory::MakeCompare(nsIMdbEnv* mev, nsIMdbCompare** acqCompare)
00327 {
00328   NS_ASSERTION(PR_FALSE, "not implemented");
00329   return NS_ERROR_NOT_IMPLEMENTED;
00330 }
00331 // } ----- end compare methods -----
00332 
00333 // { ----- begin row methods -----
00334 NS_IMETHODIMP
00335 morkFactory::MakeRow(nsIMdbEnv* mev, nsIMdbHeap* ioHeap,
00336   nsIMdbRow** acqRow)
00337 {
00338   NS_ASSERTION(PR_FALSE, "not implemented");
00339   return NS_ERROR_NOT_IMPLEMENTED;
00340 }
00341 // ioHeap can be nil, causing the heap associated with ev to be used
00342 // } ----- end row methods -----
00343 
00344 // { ----- begin port methods -----
00345 NS_IMETHODIMP
00346 morkFactory::CanOpenFilePort(
00347   nsIMdbEnv* mev, // context
00348   // const char* inFilePath, // the file to investigate
00349   // const mdbYarn* inFirst512Bytes,
00350   nsIMdbFile* ioFile, // db abstract file interface
00351   mdb_bool* outCanOpen, // whether OpenFilePort() might succeed
00352   mdbYarn* outFormatVersion)
00353 {
00354   mdb_err outErr = 0;
00355   if ( outFormatVersion )
00356   {
00357     outFormatVersion->mYarn_Fill = 0;
00358   }
00359   mdb_bool canOpenAsPort = morkBool_kFalse;
00360   morkEnv* ev = morkEnv::FromMdbEnv(mev);
00361   if ( ev )
00362   {
00363     if ( ioFile && outCanOpen )
00364     {
00365       canOpenAsPort = this->CanOpenMorkTextFile(ev, ioFile);
00366     }
00367     else
00368       ev->NilPointerError();
00369     
00370     outErr = ev->AsErr();
00371   }
00372     
00373   if ( outCanOpen )
00374     *outCanOpen = canOpenAsPort;
00375     
00376   return outErr;
00377 }
00378   
00379 NS_IMETHODIMP
00380 morkFactory::OpenFilePort(
00381   nsIMdbEnv* mev, // context
00382   nsIMdbHeap* ioHeap, // can be nil to cause ev's heap attribute to be used
00383   // const char* inFilePath, // the file to open for readonly import
00384   nsIMdbFile* ioFile, // db abstract file interface
00385   const mdbOpenPolicy* inOpenPolicy, // runtime policies for using db
00386   nsIMdbThumb** acqThumb)
00387 {
00388   NS_ASSERTION(PR_FALSE, "this doesn't look implemented");
00389   MORK_USED_1(ioHeap);
00390   mdb_err outErr = 0;
00391   nsIMdbThumb* outThumb = 0;
00392   morkEnv* ev = morkEnv::FromMdbEnv(mev);
00393    if ( ev )
00394   {
00395     if ( ioFile && inOpenPolicy && acqThumb )
00396     {
00397     }
00398     else
00399       ev->NilPointerError();
00400     
00401     outErr = ev->AsErr();
00402   }
00403   if ( acqThumb )
00404     *acqThumb = outThumb;
00405   return outErr;
00406 }
00407 // Call nsIMdbThumb::DoMore() until done, or until the thumb is broken, and
00408 // then call nsIMdbFactory::ThumbToOpenPort() to get the port instance.
00409 
00410 NS_IMETHODIMP
00411 morkFactory::ThumbToOpenPort( // redeeming a completed thumb from OpenFilePort()
00412   nsIMdbEnv* mev, // context
00413   nsIMdbThumb* ioThumb, // thumb from OpenFilePort() with done status
00414   nsIMdbPort** acqPort)
00415 {
00416   mdb_err outErr = 0;
00417   nsIMdbPort* outPort = 0;
00418   morkEnv* ev = morkEnv::FromMdbEnv(mev);
00419   if ( ev )
00420   {
00421     if ( ioThumb && acqPort )
00422     {
00423       morkThumb* thumb = (morkThumb*) ioThumb;
00424       morkStore* store = thumb->ThumbToOpenStore(ev);
00425       if ( store )
00426       {
00427         store->mStore_CanAutoAssignAtomIdentity = morkBool_kTrue;
00428         store->mStore_CanDirty = morkBool_kTrue;
00429         store->SetStoreAndAllSpacesCanDirty(ev, morkBool_kTrue);
00430         
00431         NS_ADDREF(store);
00432         outPort = store;
00433       }
00434     }
00435     else
00436       ev->NilPointerError();
00437     
00438     outErr = ev->AsErr();
00439   }
00440   if ( acqPort )
00441     *acqPort = outPort;
00442   return outErr;
00443 }
00444 // } ----- end port methods -----
00445 
00446 mork_bool
00447 morkFactory::CanOpenMorkTextFile(morkEnv* ev,
00448   // const mdbYarn* inFirst512Bytes,
00449   nsIMdbFile* ioFile)
00450 {
00451   MORK_USED_1(ev);
00452   mork_bool outBool = morkBool_kFalse;
00453   mork_size headSize = MORK_STRLEN(morkWriter_kFileHeader);
00454   
00455   char localBuf[ 256 + 4 ]; // for extra for sloppy safety
00456   mdbYarn localYarn;
00457   mdbYarn* y = &localYarn;
00458   y->mYarn_Buf = localBuf; // space to hold content
00459   y->mYarn_Fill = 0;       // no logical content yet
00460   y->mYarn_Size = 256;     // physical capacity is 256 bytes
00461   y->mYarn_More = 0;
00462   y->mYarn_Form = 0;
00463   y->mYarn_Grow = 0;
00464   
00465   if ( ioFile )
00466   {
00467     nsIMdbEnv* menv = ev->AsMdbEnv();
00468     mdb_size actualSize = 0;
00469     ioFile->Get(menv, y->mYarn_Buf, y->mYarn_Size, /*pos*/ 0, &actualSize);
00470     y->mYarn_Fill = actualSize;
00471     
00472     if ( y->mYarn_Buf && actualSize >= headSize && ev->Good() )
00473     {
00474       mork_u1* buf = (mork_u1*) y->mYarn_Buf;
00475       outBool = ( MORK_MEMCMP(morkWriter_kFileHeader, buf, headSize) == 0 );
00476     }
00477   }
00478   else
00479     ev->NilPointerError();
00480 
00481   return outBool;
00482 }
00483 
00484 // { ----- begin store methods -----
00485 NS_IMETHODIMP
00486 morkFactory::CanOpenFileStore(
00487   nsIMdbEnv* mev, // context
00488   // const char* inFilePath, // the file to investigate
00489   // const mdbYarn* inFirst512Bytes,
00490   nsIMdbFile* ioFile, // db abstract file interface
00491   mdb_bool* outCanOpenAsStore, // whether OpenFileStore() might succeed
00492   mdb_bool* outCanOpenAsPort, // whether OpenFilePort() might succeed
00493   mdbYarn* outFormatVersion)
00494 {
00495   mdb_bool canOpenAsStore = morkBool_kFalse;
00496   mdb_bool canOpenAsPort = morkBool_kFalse;
00497   if ( outFormatVersion )
00498   {
00499     outFormatVersion->mYarn_Fill = 0;
00500   }
00501   mdb_err outErr = 0;
00502   morkEnv* ev = morkEnv::FromMdbEnv(mev);
00503   if ( ev )
00504   {
00505     if ( ioFile && outCanOpenAsStore )
00506     {
00507       // right now always say true; later we should look for magic patterns
00508       canOpenAsStore = this->CanOpenMorkTextFile(ev, ioFile);
00509       canOpenAsPort = canOpenAsStore;
00510     }
00511     else
00512       ev->NilPointerError();
00513     
00514     outErr = ev->AsErr();
00515   }
00516   if ( outCanOpenAsStore )
00517     *outCanOpenAsStore = canOpenAsStore;
00518     
00519   if ( outCanOpenAsPort )
00520     *outCanOpenAsPort = canOpenAsPort;
00521     
00522   return outErr;
00523 }
00524   
00525 NS_IMETHODIMP
00526 morkFactory::OpenFileStore( // open an existing database
00527   nsIMdbEnv* mev, // context
00528   nsIMdbHeap* ioHeap, // can be nil to cause ev's heap attribute to be used
00529   // const char* inFilePath, // the file to open for general db usage
00530   nsIMdbFile* ioFile, // db abstract file interface
00531   const mdbOpenPolicy* inOpenPolicy, // runtime policies for using db
00532   nsIMdbThumb** acqThumb)
00533 {
00534   mdb_err outErr = 0;
00535   nsIMdbThumb* outThumb = 0;
00536   morkEnv* ev = morkEnv::FromMdbEnv(mev);
00537   if ( ev )
00538   {
00539     if ( !ioHeap ) // need to use heap from env?
00540       ioHeap = ev->mEnv_Heap;
00541     
00542     if ( ioFile && inOpenPolicy && acqThumb )
00543     {
00544       morkStore* store = new(*ioHeap, ev)
00545         morkStore(ev, morkUsage::kHeap, ioHeap, this, ioHeap);
00546         
00547       if ( store )
00548       {
00549         mork_bool frozen = morkBool_kFalse; // open store mutable access
00550         if ( store->OpenStoreFile(ev, frozen, ioFile, inOpenPolicy) )
00551         {
00552           morkThumb* thumb = morkThumb::Make_OpenFileStore(ev, ioHeap, store);
00553           if ( thumb )
00554           {
00555             outThumb = thumb;
00556             thumb->AddRef();
00557           }
00558         }
00559 //        store->CutStrongRef(mev); // always cut ref (handle has its own ref)
00560       }
00561     }
00562     else
00563       ev->NilPointerError();
00564     
00565     outErr = ev->AsErr();
00566   }
00567   if ( acqThumb )
00568     *acqThumb = outThumb;
00569   return outErr;
00570 }
00571 // Call nsIMdbThumb::DoMore() until done, or until the thumb is broken, and
00572 // then call nsIMdbFactory::ThumbToOpenStore() to get the store instance.
00573   
00574 NS_IMETHODIMP
00575 morkFactory::ThumbToOpenStore( // redeem completed thumb from OpenFileStore()
00576   nsIMdbEnv* mev, // context
00577   nsIMdbThumb* ioThumb, // thumb from OpenFileStore() with done status
00578   nsIMdbStore** acqStore)
00579 {
00580   mdb_err outErr = 0;
00581   nsIMdbStore* outStore = 0;
00582   morkEnv* ev = morkEnv::FromMdbEnv(mev);
00583   if ( ev )
00584   {
00585     if ( ioThumb && acqStore )
00586     {
00587       morkThumb* thumb = (morkThumb*) ioThumb;
00588       morkStore* store = thumb->ThumbToOpenStore(ev);
00589       if ( store )
00590       {
00591         store->mStore_CanAutoAssignAtomIdentity = morkBool_kTrue;
00592         store->mStore_CanDirty = morkBool_kTrue;
00593         store->SetStoreAndAllSpacesCanDirty(ev, morkBool_kTrue);
00594         
00595         outStore = store;
00596         NS_ADDREF(store);
00597       }
00598     }
00599     else
00600       ev->NilPointerError();
00601     
00602     outErr = ev->AsErr();
00603   }
00604   if ( acqStore )
00605     *acqStore = outStore;
00606   return outErr;
00607 }
00608 
00609 NS_IMETHODIMP
00610 morkFactory::CreateNewFileStore( // create a new db with minimal content
00611   nsIMdbEnv* mev, // context
00612   nsIMdbHeap* ioHeap, // can be nil to cause ev's heap attribute to be used
00613   // const char* inFilePath, // name of file which should not yet exist
00614   nsIMdbFile* ioFile, // db abstract file interface
00615   const mdbOpenPolicy* inOpenPolicy, // runtime policies for using db
00616   nsIMdbStore** acqStore)
00617 {
00618   mdb_err outErr = 0;
00619   nsIMdbStore* outStore = 0;
00620   morkEnv* ev = morkEnv::FromMdbEnv(mev);
00621   if ( ev )
00622   {
00623     if ( !ioHeap ) // need to use heap from env?
00624       ioHeap = ev->mEnv_Heap;
00625     
00626     if ( ioFile && inOpenPolicy && acqStore && ioHeap )
00627     {
00628       morkStore* store = new(*ioHeap, ev)
00629         morkStore(ev, morkUsage::kHeap, ioHeap, this, ioHeap);
00630         
00631       if ( store )
00632       {
00633         store->mStore_CanAutoAssignAtomIdentity = morkBool_kTrue;
00634         store->mStore_CanDirty = morkBool_kTrue;
00635         store->SetStoreAndAllSpacesCanDirty(ev, morkBool_kTrue);
00636 
00637         if ( store->CreateStoreFile(ev, ioFile, inOpenPolicy) )
00638           outStore = store;
00639         NS_ADDREF(store);          
00640       }
00641     }
00642     else
00643       ev->NilPointerError();
00644     
00645     outErr = ev->AsErr();
00646   }
00647   if ( acqStore )
00648     *acqStore = outStore;
00649   return outErr;
00650 }
00651 // } ----- end store methods -----
00652 
00653 // } ===== end nsIMdbFactory methods =====
00654 
00655 
00656 //3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789