modfilebase.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright           : (C) 2011 by Mathias Panzenböck
00003     email               : grosser.meister.morti@gmx.net
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., 51 Franklin Street, Fifth Floor, Boston,            *
00019  *   MA  02110-1301  USA                                                   *
00020  ***************************************************************************/
00021 
00022 #ifndef TAGLIB_MODFILEBASE_H
00023 #define TAGLIB_MODFILEBASE_H
00024 
00025 #include "taglib.h"
00026 #include "tfile.h"
00027 #include "tstring.h"
00028 #include "tlist.h"
00029 #include "taglib_export.h"
00030 
00031 #include <algorithm>
00032 
00033 namespace TagLib {
00034 
00035   namespace Mod {
00036 
00037     class TAGLIB_EXPORT FileBase : public TagLib::File
00038     {
00039     protected:
00040       FileBase(FileName file);
00041       FileBase(IOStream *stream);
00042 
00043       void writeString(const String &s, ulong size, char padding = 0);
00044       void writeByte(uchar byte);
00045       void writeU16L(ushort number);
00046       void writeU32L(ulong number);
00047       void writeU16B(ushort number);
00048       void writeU32B(ulong number);
00049 
00050       bool readString(String &s, ulong size);
00051       bool readByte(uchar &byte);
00052       bool readU16L(ushort &number);
00053       bool readU32L(ulong &number);
00054       bool readU16B(ushort &number);
00055       bool readU32B(ulong &number);
00056     };
00057 
00058   }
00059 
00060 }
00061 
00062 #endif