diff options
Diffstat (limited to 'dom/xslt/xslt/txToplevelItems.cpp')
-rw-r--r-- | dom/xslt/xslt/txToplevelItems.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/dom/xslt/xslt/txToplevelItems.cpp b/dom/xslt/xslt/txToplevelItems.cpp new file mode 100644 index 0000000000..204111cc25 --- /dev/null +++ b/dom/xslt/xslt/txToplevelItems.cpp @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#include "txToplevelItems.h" + +#include <utility> + +#include "txInstructions.h" +#include "txStylesheet.h" +#include "txXSLTPatterns.h" + +using mozilla::UniquePtr; + +TX_IMPL_GETTYPE(txAttributeSetItem, txToplevelItem::attributeSet) +TX_IMPL_GETTYPE(txImportItem, txToplevelItem::import) +TX_IMPL_GETTYPE(txOutputItem, txToplevelItem::output) +TX_IMPL_GETTYPE(txDummyItem, txToplevelItem::dummy) + +TX_IMPL_GETTYPE(txStripSpaceItem, txToplevelItem::stripSpace) + +txStripSpaceItem::~txStripSpaceItem() { + int32_t i, count = mStripSpaceTests.Length(); + for (i = 0; i < count; ++i) { + delete mStripSpaceTests[i]; + } +} + +void txStripSpaceItem::addStripSpaceTest(txStripSpaceTest* aStripSpaceTest) { + mStripSpaceTests.AppendElement(aStripSpaceTest); +} + +TX_IMPL_GETTYPE(txTemplateItem, txToplevelItem::templ) + +txTemplateItem::txTemplateItem(UniquePtr<txPattern>&& aMatch, + const txExpandedName& aName, + const txExpandedName& aMode, double aPrio) + : mMatch(std::move(aMatch)), mName(aName), mMode(aMode), mPrio(aPrio) {} + +TX_IMPL_GETTYPE(txVariableItem, txToplevelItem::variable) + +txVariableItem::txVariableItem(const txExpandedName& aName, + UniquePtr<Expr>&& aValue, bool aIsParam) + : mName(aName), mValue(std::move(aValue)), mIsParam(aIsParam) {} |