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 
35 namespace 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 
114  FileRef();
115 
125  explicit FileRef(FileName fileName,
126  bool readAudioProperties = true,
128  audioPropertiesStyle = AudioProperties::Average);
129 
134  explicit FileRef(File *file);
135 
139  FileRef(const FileRef &ref);
140 
144  virtual ~FileRef();
145 
157  Tag *tag() const;
158 
163  AudioProperties *audioProperties() const;
164 
180  File *file() const;
181 
185  bool save();
186 
199  static const FileTypeResolver *addFileTypeResolver(const FileTypeResolver *resolver);
200 
217  static StringList defaultFileExtensions();
218 
222  bool isNull() const;
223 
227  FileRef &operator=(const FileRef &ref);
228 
232  bool operator==(const FileRef &ref) const;
233 
238  bool operator!=(const FileRef &ref) const;
239 
251  static File *create(FileName fileName,
252  bool readAudioProperties = true,
254 
255 
256  private:
257  class FileRefPrivate;
258  FileRefPrivate *d;
259  };
260 
261 } // namespace TagLib
262 
263 #endif