Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/xslt/base/txExpandedName.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/. */
5
6
#ifndef TRANSFRMX_EXPANDEDNAME_H
7
#define TRANSFRMX_EXPANDEDNAME_H
8
9
#include "nsCOMPtr.h"
10
#include "nsAtom.h"
11
#include "mozilla/dom/NameSpaceConstants.h"
12
13
class txNamespaceMap;
14
15
class txExpandedName {
16
public:
17
    txExpandedName() : mNamespaceID(kNameSpaceID_None)
18
0
    {
19
0
    }
20
21
    txExpandedName(int32_t aNsID,
22
                   nsAtom* aLocalName) : mNamespaceID(aNsID),
23
                                          mLocalName(aLocalName)
24
123
    {
25
123
    }
26
27
    txExpandedName(const txExpandedName& aOther) :
28
        mNamespaceID(aOther.mNamespaceID),
29
        mLocalName(aOther.mLocalName)
30
0
    {
31
0
    }
32
33
    nsresult init(const nsAString& aQName, txNamespaceMap* aResolver,
34
                  bool aUseDefault);
35
36
    void reset()
37
0
    {
38
0
        mNamespaceID = kNameSpaceID_None;
39
0
        mLocalName = nullptr;
40
0
    }
41
42
    bool isNull()
43
0
    {
44
0
        return mNamespaceID == kNameSpaceID_None && !mLocalName;
45
0
    }
46
47
    txExpandedName& operator = (const txExpandedName& rhs)
48
0
    {
49
0
        mNamespaceID = rhs.mNamespaceID;
50
0
        mLocalName = rhs.mLocalName;
51
0
        return *this;
52
0
    }
53
54
    bool operator == (const txExpandedName& rhs) const
55
0
    {
56
0
        return ((mLocalName == rhs.mLocalName) &&
57
0
                (mNamespaceID == rhs.mNamespaceID));
58
0
    }
59
60
    bool operator != (const txExpandedName& rhs) const
61
0
    {
62
0
        return ((mLocalName != rhs.mLocalName) ||
63
0
                (mNamespaceID != rhs.mNamespaceID));
64
0
    }
65
66
    int32_t mNamespaceID;
67
    RefPtr<nsAtom> mLocalName;
68
};
69
70
#endif