2005-11-02 07:40:09 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2005-11-02 07:40:09 +00:00
|
|
|
|
|
|
|
#ifndef TRANSFRMX_TXNAMESPACEMAP_H
|
|
|
|
#define TRANSFRMX_TXNAMESPACEMAP_H
|
|
|
|
|
|
|
|
#include "nsIAtom.h"
|
|
|
|
#include "nsCOMArray.h"
|
2009-03-20 08:15:35 +00:00
|
|
|
#include "nsTArray.h"
|
2005-11-02 07:40:09 +00:00
|
|
|
|
|
|
|
class txNamespaceMap
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
txNamespaceMap();
|
|
|
|
txNamespaceMap(const txNamespaceMap& aOther);
|
|
|
|
|
|
|
|
nsrefcnt AddRef()
|
|
|
|
{
|
|
|
|
return ++mRefCnt;
|
|
|
|
}
|
|
|
|
nsrefcnt Release()
|
|
|
|
{
|
|
|
|
if (--mRefCnt == 0) {
|
|
|
|
mRefCnt = 1; //stabilize
|
|
|
|
delete this;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return mRefCnt;
|
|
|
|
}
|
|
|
|
|
2006-05-19 10:29:43 +00:00
|
|
|
nsresult mapNamespace(nsIAtom* aPrefix, const nsAString& aNamespaceURI);
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t lookupNamespace(nsIAtom* aPrefix);
|
|
|
|
int32_t lookupNamespaceWithDefault(const nsAString& aPrefix);
|
2005-11-02 07:40:09 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
nsAutoRefCnt mRefCnt;
|
|
|
|
nsCOMArray<nsIAtom> mPrefixes;
|
2012-08-22 15:56:38 +00:00
|
|
|
nsTArray<int32_t> mNamespaces;
|
2005-11-02 07:40:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //TRANSFRMX_TXNAMESPACEMAP_H
|