mp4atom.h

Go to the documentation of this file.
00001 /**************************************************************************
00002     copyright            : (C) 2007 by Lukáš Lalinský
00003     email                : lalinsky@gmail.com
00004  **************************************************************************/
00005 
00006 /***************************************************************************
00007  *   This library is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU Lesser General Public License version   *
00009  *   2.1 as published by the Free Software Foundation.                     *
00010  *                                                                         *
00011  *   This library is distributed in the hope that it will be useful, but   *
00012  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014  *   Lesser General Public License for more details.                       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with this library; if not, write to the Free Software   *
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
00019  *   USA                                                                   *
00020  *                                                                         *
00021  *   Alternatively, this file is available under the Mozilla Public        *
00022  *   License Version 1.1.  You may obtain a copy of the License at         *
00023  *   http://www.mozilla.org/MPL/                                           *
00024  ***************************************************************************/
00025 
00026 // This file is not part of the public API!
00027 
00028 #ifndef DO_NOT_DOCUMENT
00029 
00030 #ifndef TAGLIB_MP4ATOM_H
00031 #define TAGLIB_MP4ATOM_H
00032 
00033 #include "tfile.h"
00034 #include "tlist.h"
00035 
00036 namespace TagLib {
00037 
00038   namespace MP4 {
00039 
00040     class Atom;
00041     typedef TagLib::List<Atom *> AtomList;
00042 
00043     class Atom
00044     {
00045     public:
00046         Atom(File *file);
00047         ~Atom();
00048         Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
00049         bool path(AtomList &path, const char *name1, const char *name2 = 0, const char *name3 = 0);
00050         AtomList findall(const char *name, bool recursive = false);
00051         long offset;
00052         long length;
00053         TagLib::ByteVector name;
00054         AtomList children;
00055     private:
00056         static const int numContainers = 10;
00057         static const char *containers[10];
00058     };
00059 
00061     class Atoms
00062     {
00063     public:
00064         Atoms(File *file);
00065         ~Atoms();
00066         Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
00067         AtomList path(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
00068         AtomList atoms;
00069     };
00070 
00071   }
00072 
00073 }
00074 
00075 #endif
00076 
00077 #endif