summaryrefslogtreecommitdiffstats
path: root/comm/mailnews/db/mork/morkYarn.cpp
blob: 013b36c754fb92e7a44b4e3be99da4264893796c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-  */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _MDB_
#  include "mdb.h"
#endif

#ifndef _MORK_
#  include "mork.h"
#endif

#ifndef _MORKNODE_
#  include "morkNode.h"
#endif

#ifndef _MORKENV_
#  include "morkEnv.h"
#endif

#ifndef _MORKYARN_
#  include "morkYarn.h"
#endif

// 456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789

// ````` ````` ````` ````` `````
// { ===== begin morkNode interface =====

/*public virtual*/ void morkYarn::CloseMorkNode(
    morkEnv* ev) /*i*/  // CloseYarn() only if open
{
  if (this->IsOpenNode()) {
    this->MarkClosing();
    this->CloseYarn(ev);
    this->MarkShut();
  }
}

/*public virtual*/
morkYarn::~morkYarn() /*i*/  // assert CloseYarn() executed earlier
{
  MORK_ASSERT(mYarn_Body.mYarn_Buf == 0);
}

/*public non-poly*/
morkYarn::morkYarn(morkEnv* ev, /*i*/
                   const morkUsage& inUsage, nsIMdbHeap* ioHeap)
    : morkNode(ev, inUsage, ioHeap) {
  if (ev->Good()) mNode_Derived = morkDerived_kYarn;
}

/*public non-poly*/ void morkYarn::CloseYarn(
    morkEnv* ev) /*i*/  // called by CloseMorkNode();
{
  if (this->IsNode())
    this->MarkShut();
  else
    this->NonNodeError(ev);
}

// } ===== end morkNode methods =====
// ````` ````` ````` ````` `````

/*static*/ void morkYarn::NonYarnTypeError(morkEnv* ev) {
  ev->NewError("non morkYarn");
}

// 456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789