michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef TRANSFRMX_TXNAMESPACEMAP_H michael@0: #define TRANSFRMX_TXNAMESPACEMAP_H michael@0: michael@0: #include "nsIAtom.h" michael@0: #include "nsCOMArray.h" michael@0: #include "nsTArray.h" michael@0: michael@0: class txNamespaceMap michael@0: { michael@0: public: michael@0: txNamespaceMap(); michael@0: txNamespaceMap(const txNamespaceMap& aOther); michael@0: michael@0: nsrefcnt AddRef() michael@0: { michael@0: return ++mRefCnt; michael@0: } michael@0: nsrefcnt Release() michael@0: { michael@0: if (--mRefCnt == 0) { michael@0: mRefCnt = 1; //stabilize michael@0: delete this; michael@0: return 0; michael@0: } michael@0: return mRefCnt; michael@0: } michael@0: michael@0: nsresult mapNamespace(nsIAtom* aPrefix, const nsAString& aNamespaceURI); michael@0: int32_t lookupNamespace(nsIAtom* aPrefix); michael@0: int32_t lookupNamespaceWithDefault(const nsAString& aPrefix); michael@0: michael@0: private: michael@0: nsAutoRefCnt mRefCnt; michael@0: nsCOMArray mPrefixes; michael@0: nsTArray mNamespaces; michael@0: }; michael@0: michael@0: #endif //TRANSFRMX_TXNAMESPACEMAP_H