tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

AtomType.h (836B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
      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 ATOM_TYPE_H_
      8 #define ATOM_TYPE_H_
      9 
     10 #include <stdint.h>
     11 
     12 #include "mozilla/EndianUtils.h"
     13 
     14 namespace mozilla {
     15 
     16 class AtomType {
     17 public:
     18  AtomType() : mType(0) {}
     19  MOZ_IMPLICIT AtomType(uint32_t aType) : mType(aType) {}
     20  MOZ_IMPLICIT AtomType(const char* aType)
     21      : mType(BigEndian::readUint32(aType)) {}
     22  bool operator==(const AtomType& aType) const { return mType == aType.mType; }
     23  bool operator!() const { return !mType; }
     24 
     25 private:
     26  uint32_t mType;
     27 };
     28 }  // namespace mozilla
     29 
     30 #endif