LCOV - code coverage report
Current view: top level - rdf/base - nsNameSpaceMap.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 20 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 10 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
       2             :  *
       3             :  * This Source Code Form is subject to the terms of the Mozilla Public
       4             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       5             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       6             : 
       7             : #ifndef nsNameSpaceMap_h__
       8             : #define nsNameSpaceMap_h__
       9             : 
      10             : #include "nsCOMPtr.h"
      11             : #include "nsString.h"
      12             : #include "nsIAtom.h"
      13             : 
      14             : class nsNameSpaceMap
      15             : {
      16             : public:
      17             :     class Entry {
      18             :     public:
      19           0 :         Entry(const nsACString& aURI, nsIAtom* aPrefix)
      20           0 :             : mURI(aURI), mPrefix(aPrefix), mNext(nullptr) {
      21           0 :             MOZ_COUNT_CTOR(nsNameSpaceMap::Entry); }
      22             : 
      23           0 :         ~Entry() { MOZ_COUNT_DTOR(nsNameSpaceMap::Entry); }
      24             : 
      25             :         nsCString mURI;
      26             :         nsCOMPtr<nsIAtom> mPrefix;
      27             : 
      28             :         Entry* mNext;
      29             :     };
      30             : 
      31             :     nsNameSpaceMap();
      32             :     ~nsNameSpaceMap();
      33             : 
      34             :     nsresult
      35             :     Put(const nsAString& aURI, nsIAtom* aPrefix);
      36             : 
      37             :     nsresult
      38             :     Put(const nsACString& aURI, nsIAtom* aPrefix);
      39             : 
      40             :     class const_iterator {
      41             :     protected:
      42             :         friend class nsNameSpaceMap;
      43             : 
      44           0 :         explicit const_iterator(const Entry* aCurrent)
      45           0 :             : mCurrent(aCurrent) {}
      46             : 
      47             :         const Entry* mCurrent;
      48             : 
      49             :     public:
      50             :         const_iterator()
      51             :             : mCurrent(nullptr) {}
      52             : 
      53           0 :         const_iterator(const const_iterator& iter)
      54           0 :             : mCurrent(iter.mCurrent) {}
      55             : 
      56             :         const_iterator&
      57             :         operator=(const const_iterator& iter) {
      58             :             mCurrent = iter.mCurrent;
      59             :             return *this; }
      60             : 
      61             :         const_iterator&
      62           0 :         operator++() {
      63           0 :             mCurrent = mCurrent->mNext;
      64           0 :             return *this; }
      65             : 
      66             :         const_iterator
      67             :         operator++(int) {
      68             :             const_iterator tmp(*this);
      69             :             mCurrent = mCurrent->mNext;
      70             :             return tmp; }
      71             : 
      72           0 :         const Entry* operator->() const { return mCurrent; }
      73             : 
      74             :         const Entry& operator*() const { return *mCurrent; }
      75             : 
      76             :         bool
      77           0 :         operator==(const const_iterator& iter) const {
      78           0 :             return mCurrent == iter.mCurrent; }
      79             : 
      80             :         bool
      81           0 :         operator!=(const const_iterator& iter) const {
      82           0 :             return ! iter.operator==(*this); }
      83             :     };
      84             : 
      85           0 :     const_iterator first() const {
      86           0 :         return const_iterator(mEntries); }
      87             : 
      88           0 :     const_iterator last() const {
      89           0 :         return const_iterator(nullptr); }
      90             : 
      91             :     const_iterator GetNameSpaceOf(const nsACString& aURI) const;
      92             : 
      93             : protected:
      94             :     Entry* mEntries;
      95             : };
      96             : 
      97             : 
      98             : #endif // nsNameSpaceMap_h__

Generated by: LCOV version 1.13