1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ***** BEGIN LICENSE BLOCK *****
3
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
5
* The contents of this file are subject to the Netscape Public License
6
* Version 1.1 (the "License"); you may not use this file except in
7
* compliance with the License. You may obtain a copy of the License at
8
* http://www.mozilla.org/NPL/
10
* Software distributed under the License is distributed on an "AS IS" basis,
11
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
* for the specific language governing rights and limitations under the
15
* The Original Code is mozilla.org code.
17
* The Initial Developer of the Original Code is
18
* Netscape Communications Corporation.
19
* Portions created by the Initial Developer are Copyright (C) 1999
20
* the Initial Developer. All Rights Reserved.
25
* Alternatively, the contents of this file may be used under the terms of
26
* either the GNU General Public License Version 2 or later (the "GPL"), or
27
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28
* in which case the provisions of the GPL or the LGPL are applicable instead
29
* of those above. If you wish to allow use of your version of this file only
30
* under the terms of either the GPL or the LGPL, and not to allow others to
31
* use your version of this file under the terms of the NPL, indicate your
32
* decision by deleting the provisions above and replace them with the notice
33
* and other provisions required by the GPL or the LGPL. If you do not delete
34
* the provisions above, a recipient may use your version of this file under
35
* the terms of any one of the NPL, the GPL or the LGPL.
37
* ***** END LICENSE BLOCK ***** */
60
#include "morkCursor.h"
63
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
65
// ````` ````` ````` ````` `````
66
// { ===== begin morkNode interface =====
68
/*public virtual*/ void
69
morkCursor::CloseMorkNode(morkEnv* ev) // CloseCursor() only if open
71
if ( this->IsOpenNode() )
74
this->CloseCursor(ev);
80
morkCursor::~morkCursor() // assert CloseCursor() executed earlier
85
morkCursor::morkCursor(morkEnv* ev,
86
const morkUsage& inUsage, nsIMdbHeap* ioHeap)
87
: morkObject(ev, inUsage, ioHeap, morkColor_kNone, (morkHandle*) 0)
90
, mCursor_DoFailOnSeedOutOfSync( morkBool_kFalse )
93
mNode_Derived = morkDerived_kCursor;
96
NS_IMPL_ISUPPORTS_INHERITED1(morkCursor, morkObject, nsIMdbCursor)
98
/*public non-poly*/ void
99
morkCursor::CloseCursor(morkEnv* ev) // called by CloseMorkNode();
103
if ( this->IsNode() )
110
this->NonNodeError(ev);
113
ev->NilPointerError();
116
// { ----- begin ref counting for well-behaved cyclic graphs -----
118
morkCursor::GetWeakRefCount(nsIMdbEnv* mev, // weak refs
121
*outCount = WeakRefsOnly();
125
morkCursor::GetStrongRefCount(nsIMdbEnv* mev, // strong refs
128
*outCount = StrongRefsOnly();
131
// ### TODO - clean up this cast, if required
133
morkCursor::AddWeakRef(nsIMdbEnv* mev)
135
return morkNode::AddWeakRef((morkEnv *) mev);
138
morkCursor::AddStrongRef(nsIMdbEnv* mev)
140
return morkNode::AddStrongRef((morkEnv *) mev);
144
morkCursor::CutWeakRef(nsIMdbEnv* mev)
146
return morkNode::CutWeakRef((morkEnv *) mev);
149
morkCursor::CutStrongRef(nsIMdbEnv* mev)
151
return morkNode::CutStrongRef((morkEnv *) mev);
156
morkCursor::CloseMdbObject(nsIMdbEnv* mev)
158
return morkNode::CloseMdbObject((morkEnv *) mev);
162
morkCursor::IsOpenMdbObject(nsIMdbEnv* mev, mdb_bool* outOpen)
164
*outOpen = IsOpenNode();
168
morkCursor::IsFrozenMdbObject(nsIMdbEnv* mev, mdb_bool* outIsReadonly)
170
*outIsReadonly = IsFrozen();
173
// } ===== end morkNode methods =====
174
// ````` ````` ````` ````` `````
177
morkCursor::GetCount(nsIMdbEnv* mev, mdb_count* outCount)
179
NS_ASSERTION(PR_FALSE, "not implemented");
180
return NS_ERROR_NOT_IMPLEMENTED;
184
morkCursor::GetSeed(nsIMdbEnv* mev, mdb_seed* outSeed)
186
NS_ASSERTION(PR_FALSE, "not implemented");
187
return NS_ERROR_NOT_IMPLEMENTED;
191
morkCursor::SetPos(nsIMdbEnv* mev, mdb_pos inPos)
193
NS_ASSERTION(PR_FALSE, "not implemented");
194
return NS_ERROR_NOT_IMPLEMENTED;
198
morkCursor::GetPos(nsIMdbEnv* mev, mdb_pos* outPos)
200
NS_ASSERTION(PR_FALSE, "not implemented");
201
return NS_ERROR_NOT_IMPLEMENTED;
205
morkCursor::SetDoFailOnSeedOutOfSync(nsIMdbEnv* mev, mdb_bool inFail)
207
NS_ASSERTION(PR_FALSE, "not implemented");
208
return NS_ERROR_NOT_IMPLEMENTED;
212
morkCursor::GetDoFailOnSeedOutOfSync(nsIMdbEnv* mev, mdb_bool* outFail)
214
NS_ASSERTION(PR_FALSE, "not implemented");
215
return NS_ERROR_NOT_IMPLEMENTED;
219
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789