fileref.h
Go to the documentation of this file.
1/***************************************************************************
2 copyright : (C) 2002 - 2008 by Scott Wheeler
3 email : wheeler@kde.org
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_FILEREF_H
27#define TAGLIB_FILEREF_H
28
29#include "tfile.h"
30#include "tstringlist.h"
31
32#include "taglib_export.h"
33#include "audioproperties.h"
34
35namespace TagLib {
36
37 class Tag;
38
40
60 {
61 public:
62
64
93 {
95 public:
105 virtual File *createFile(FileName fileName,
106 bool readAudioProperties = true,
108 audioPropertiesStyle = AudioProperties::Average) const = 0;
109 };
110
115
125 explicit FileRef(FileName fileName,
126 bool readAudioProperties = true,
128 audioPropertiesStyle = AudioProperties::Average);
129
142 explicit FileRef(IOStream* stream,
143 bool readAudioProperties = true,
145 audioPropertiesStyle = AudioProperties::Average);
146
151 explicit FileRef(File *file);
152
156 FileRef(const FileRef &ref);
157
161 virtual ~FileRef();
162
174 Tag *tag() const;
175
181
197 File *file() const;
198
202 bool save();
203
217
235
239 bool isNull() const;
240
245
249 void swap(FileRef &ref);
250
254 bool operator==(const FileRef &ref) const;
255
260 bool operator!=(const FileRef &ref) const;
261
273 static File *create(FileName fileName,
274 bool readAudioProperties = true,
275 AudioProperties::ReadStyle audioPropertiesStyle = AudioProperties::Average);
276
277 private:
278 void parse(FileName fileName, bool readAudioProperties, AudioProperties::ReadStyle audioPropertiesStyle);
279 void parse(IOStream *stream, bool readAudioProperties, AudioProperties::ReadStyle audioPropertiesStyle);
280
281 class FileRefPrivate;
282 FileRefPrivate *d;
283 };
284
285} // namespace TagLib
286
287#endif
A simple, abstract interface to common audio properties.
Definition audioproperties.h:43
ReadStyle
Definition audioproperties.h:53
A class for pluggable file type resolution.
Definition fileref.h:93
virtual File * createFile(FileName fileName, bool readAudioProperties=true, AudioProperties::ReadStyle audioPropertiesStyle=AudioProperties::Average) const =0
This class provides a simple abstraction for creating and handling files.
Definition fileref.h:60
Tag * tag() const
void swap(FileRef &ref)
static StringList defaultFileExtensions()
static const FileTypeResolver * addFileTypeResolver(const FileTypeResolver *resolver)
FileRef(const FileRef &ref)
bool operator!=(const FileRef &ref) const
static File * create(FileName fileName, bool readAudioProperties=true, AudioProperties::ReadStyle audioPropertiesStyle=AudioProperties::Average)
FileRef(File *file)
FileRef(IOStream *stream, bool readAudioProperties=true, AudioProperties::ReadStyle audioPropertiesStyle=AudioProperties::Average)
virtual ~FileRef()
File * file() const
FileRef(FileName fileName, bool readAudioProperties=true, AudioProperties::ReadStyle audioPropertiesStyle=AudioProperties::Average)
AudioProperties * audioProperties() const
bool isNull() const
FileRef & operator=(const FileRef &ref)
bool operator==(const FileRef &ref) const
A file class with some useful methods for tag manipulation.
Definition tfile.h:51
An abstract class that provides operations on a sequence of bytes.
Definition tiostream.h:63
A list of strings.
Definition tstringlist.h:46
Definition tag.h:47
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
const char * FileName
Definition tiostream.h:57
#define TAGLIB_IGNORE_MISSING_DESTRUCTOR
Definition taglib.h:38
#define TAGLIB_EXPORT
Definition taglib_export.h:40