src/foundation/ZNodeRep_Wrapper.h

00001 /*  @(#) $Id: ZNodeRep_Wrapper.h,v 1.3 2006/07/23 22:00:42 agreen Exp $ */
00002 
00003 /* ------------------------------------------------------------
00004 Copyright (c) 2006 Andrew Green and Learning in Motion, Inc.
00005 http://www.zoolib.org
00006 
00007 Permission is hereby granted, free of charge, to any person obtaining a copy
00008 of this software and associated documentation files (the "Software"), to deal
00009 in the Software without restriction, including without limitation the rights
00010 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00011 copies of the Software, and to permit persons to whom the Software is
00012 furnished to do so, subject to the following conditions:
00013 
00014 The above copyright notice and this permission notice shall be included in
00015 all copies or substantial portions of the Software.
00016 
00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00018 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00020 COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00021 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00022 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00023 ------------------------------------------------------------ */
00024 
00025 #ifndef __ZNodeRep_Wrapper__
00026 #define __ZNodeRep_Wrapper__ 1
00027 #include "zconfig.h"
00028 
00029 #include "ZNode.h"
00030 
00031 // =================================================================================================
00032 #pragma mark -
00033 #pragma mark * ZNodeRep_Wrapper
00034 
00035 class ZNodeRep_Wrapper : public ZNodeRep
00036         {
00037 public:
00038         ZNodeRep_Wrapper(ZRef<ZNodeRep> iParent, const std::string& iName,
00039                 size_t iDepth, ZRef<ZNodeRep> iNodeRep);
00040 
00041 // From ZNodeRep
00042         virtual ZRef<ZNodeIterRep> CreateIterRep();
00043 
00044         virtual bool GetProp(const std::string& iPropName, ZTupleValue& oTV, Error* oError);
00045         virtual bool CanHaveChildren(Error* oError);
00046 
00047         virtual std::string GetName(Error* oError);
00048         virtual ZTrail TrailTo(ZRef<ZNodeRep> iDest, Error* oError);
00049 
00050         virtual ZRef<ZNodeRep> GetAncestor(size_t iCount, Error* oError);
00051         virtual ZRef<ZNodeRep> GetDescendant(const std::string* iComps, size_t iCount, Error* oError);
00052 
00053         virtual bool Exists(Error* oError);
00054 
00055         virtual ZRef<ZNodeRep> CreateDir(Error* oError);
00056 
00057         virtual ZRef<ZNodeRep> MoveTo(ZRef<ZNodeRep> iDest, Error* oError);
00058         virtual bool Delete(Error* oError);
00059 
00060         virtual ZRef<ZStreamerR> OpenR(bool iPreventWriters, Error* oError);
00061         virtual ZRef<ZStreamerRPos> OpenRPos(bool iPreventWriters, Error* oError);
00062         virtual ZRef<ZStreamerW> OpenW(bool iPreventWriters, Error* oError);
00063         virtual ZRef<ZStreamerWPos> OpenWPos(bool iPreventWriters, Error* oError);
00064         virtual ZRef<ZStreamerRWPos> OpenRWPos(bool iPreventWriters, Error* oError);
00065 
00066         virtual ZRef<ZStreamerWPos> CreateWPos(bool iOpenExisting,
00067                 bool iPreventWriters, Error* oError);
00068 
00069         virtual ZRef<ZStreamerRWPos> CreateRWPos(bool iOpenExisting,
00070                 bool iPreventWriters, Error* oError);
00071 
00072 // Our protocol
00073         ZRef<ZNodeRep> GetRealNodeRep();
00074 
00075 private:
00076         ZRef<ZNodeRep> fParent;
00077         std::string fName;
00078         size_t fDepth;
00079         ZRef<ZNodeRep> fNodeRep;
00080         };
00081 
00082 #endif // __ZNodeRep_Wrapper__

Generated on Thu Jul 26 11:21:51 2007 for ZooLib by  doxygen 1.4.7