TagLib  2.2.1
modfilebase.h
Go to the documentation of this file.
1 /***************************************************************************
2  copyright : (C) 2011 by Mathias Panzenböck
3  email : grosser.meister.morti@gmx.net
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 #ifndef TAGLIB_MODFILEBASE_H
27 #define TAGLIB_MODFILEBASE_H
28 
29 #include "taglib.h"
30 #include "tfile.h"
31 #include "tlist.h"
32 #include "taglib_export.h"
33 
34 namespace TagLib {
35  namespace Mod {
38  {
39  public:
40  ~FileBase() override;
41 
42  FileBase(const FileBase &) = delete;
43  FileBase& operator=(const FileBase &) = delete;
44 
45  protected:
46  FileBase(FileName file);
47  FileBase(IOStream *stream);
48 
49  void writeString(const String &s, unsigned long size, char padding = 0);
50  void writeByte(unsigned char byte);
51  void writeU16L(unsigned short number);
52  void writeU32L(unsigned long number);
53  void writeU16B(unsigned short number);
54  void writeU32B(unsigned long number);
55 
56  bool readString(String &s, unsigned long size);
57  bool readByte(unsigned char &byte);
58  bool readU16L(unsigned short &number);
59  bool readU32L(unsigned long &number);
60  bool readU16B(unsigned short &number);
61  bool readU32B(unsigned long &number);
62  private:
63  class FileBasePrivate;
65  std::unique_ptr<FileBasePrivate> d;
66  };
67  } // namespace Mod
68 } // namespace TagLib
69 #endif
An abstract class that provides operations on a sequence of bytes.
Definition: tiostream.h:64
Base class for module files.
Definition: modfilebase.h:37
A file class with some useful methods for tag manipulation.
Definition: tfile.h:50
A wide string class suitable for unicode.
Definition: tstring.h:82
const char * FileName
Definition: tiostream.h:59
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41