1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "txToplevelItems.h"
10 #include "txInstructions.h"
11 #include "txStylesheet.h"
12 #include "txXSLTPatterns.h"
14 using mozilla::UniquePtr
;
16 TX_IMPL_GETTYPE(txAttributeSetItem
, txToplevelItem::attributeSet
)
17 TX_IMPL_GETTYPE(txImportItem
, txToplevelItem::import
)
18 TX_IMPL_GETTYPE(txOutputItem
, txToplevelItem::output
)
19 TX_IMPL_GETTYPE(txDummyItem
, txToplevelItem::dummy
)
21 TX_IMPL_GETTYPE(txStripSpaceItem
, txToplevelItem::stripSpace
)
23 txStripSpaceItem::~txStripSpaceItem() {
24 int32_t i
, count
= mStripSpaceTests
.Length();
25 for (i
= 0; i
< count
; ++i
) {
26 delete mStripSpaceTests
[i
];
30 void txStripSpaceItem::addStripSpaceTest(txStripSpaceTest
* aStripSpaceTest
) {
31 mStripSpaceTests
.AppendElement(aStripSpaceTest
);
34 TX_IMPL_GETTYPE(txTemplateItem
, txToplevelItem::templ
)
36 txTemplateItem::txTemplateItem(UniquePtr
<txPattern
>&& aMatch
,
37 const txExpandedName
& aName
,
38 const txExpandedName
& aMode
, double aPrio
)
39 : mMatch(std::move(aMatch
)), mName(aName
), mMode(aMode
), mPrio(aPrio
) {}
41 TX_IMPL_GETTYPE(txVariableItem
, txToplevelItem::variable
)
43 txVariableItem::txVariableItem(const txExpandedName
& aName
,
44 UniquePtr
<Expr
>&& aValue
, bool aIsParam
)
45 : mName(aName
), mValue(std::move(aValue
)), mIsParam(aIsParam
) {}