mp4atom.h
Go to the documentation of this file.
1 /**************************************************************************
2  copyright : (C) 2007 by Lukáš Lalinský
3  email : lalinsky@gmail.com
4  **************************************************************************/
5 
6 /***************************************************************************
7  * This library is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU Lesser General Public License version *
9  * 2.1 as published by the Free Software Foundation. *
10  * *
11  * This library is distributed in the hope that it will be useful, but *
12  * WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the Free Software *
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
19  * 02110-1301 USA *
20  * *
21  * Alternatively, this file is available under the Mozilla Public *
22  * License Version 1.1. You may obtain a copy of the License at *
23  * http://www.mozilla.org/MPL/ *
24  ***************************************************************************/
25 
26 // This file is not part of the public API!
27 
28 #ifndef DO_NOT_DOCUMENT
29 
30 #ifndef TAGLIB_MP4ATOM_H
31 #define TAGLIB_MP4ATOM_H
32 
33 #include "tfile.h"
34 #include "tlist.h"
35 
36 namespace TagLib {
37 
38  namespace MP4 {
39 
40  class Atom;
41  typedef TagLib::List<Atom *> AtomList;
42 
43  class Atom
44  {
45  public:
46  Atom(File *file);
47  ~Atom();
48  Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
49  bool path(AtomList &path, const char *name1, const char *name2 = 0, const char *name3 = 0);
50  AtomList findall(const char *name, bool recursive = false);
51  long offset;
52  long length;
53  TagLib::ByteVector name;
54  AtomList children;
55  private:
56  static const int numContainers = 10;
57  static const char *containers[10];
58  };
59 
61  class Atoms
62  {
63  public:
64  Atoms(File *file);
65  ~Atoms();
66  Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
67  AtomList path(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
68  AtomList atoms;
69  };
70 
71  }
72 
73 }
74 
75 #endif
76 
77 #endif