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, MA         *
00019  *   02110-1301  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 #ifndef TAGLIB_MODFILEBASE_H
00027 #define TAGLIB_MODFILEBASE_H
00028 
00029 #include "taglib.h"
00030 #include "tfile.h"
00031 #include "tstring.h"
00032 #include "tlist.h"
00033 #include "taglib_export.h"
00034 
00035 #include <algorithm>
00036 
00037 namespace TagLib {
00038 
00039   namespace Mod {
00040 
00041     class TAGLIB_EXPORT FileBase : public TagLib::File
00042     {
00043     protected:
00044       FileBase(FileName file);
00045       FileBase(IOStream *stream);
00046 
00047       void writeString(const String &s, unsigned long size, char padding = 0);
00048       void writeByte(unsigned char byte);
00049       void writeU16L(unsigned short number);
00050       void writeU32L(unsigned long number);
00051       void writeU16B(unsigned short number);
00052       void writeU32B(unsigned long number);
00053 
00054       bool readString(String &s, unsigned long size);
00055       bool readByte(unsigned char &byte);
00056       bool readU16L(unsigned short &number);
00057       bool readU32L(unsigned long &number);
00058       bool readU16B(unsigned short &number);
00059       bool readU32B(unsigned long &number);
00060     };
00061 
00062   }
00063 
00064 }
00065 
00066 #endif