Line data Source code
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 : #include "mozilla/EndianUtils.h"
12 :
13 : using namespace mozilla;
14 :
15 : namespace mp4_demuxer {
16 :
17 : class AtomType
18 : {
19 : public:
20 0 : AtomType() : mType(0) { }
21 0 : MOZ_IMPLICIT AtomType(uint32_t aType) : mType(aType) { }
22 0 : MOZ_IMPLICIT AtomType(const char* aType) : mType(BigEndian::readUint32(aType)) { }
23 0 : bool operator==(const AtomType& aType) const { return mType == aType.mType; }
24 0 : bool operator!() const { return !mType; }
25 :
26 : private:
27 : uint32_t mType;
28 : };
29 : }
30 :
31 : #endif
|