tfilestream.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef TAGLIB_FILESTREAM_H
00027 #define TAGLIB_FILESTREAM_H
00028
00029 #include "taglib_export.h"
00030 #include "taglib.h"
00031 #include "tbytevector.h"
00032 #include "tiostream.h"
00033
00034 namespace TagLib {
00035
00036 class String;
00037 class Tag;
00038 class AudioProperties;
00039
00041
00048 class TAGLIB_EXPORT FileStream : public IOStream
00049 {
00050 public:
00055 FileStream(FileName file, bool openReadOnly = false);
00056
00060 virtual ~FileStream();
00061
00065 FileName name() const;
00066
00070 ByteVector readBlock(unsigned long length);
00071
00081 void writeBlock(const ByteVector &data);
00082
00090 void insert(const ByteVector &data, unsigned long start = 0, unsigned long replace = 0);
00091
00099 void removeBlock(unsigned long start = 0, unsigned long length = 0);
00100
00104 bool readOnly() const;
00105
00110 bool isOpen() const;
00111
00118 void seek(long offset, Position p = Beginning);
00119
00123 void clear();
00124
00128 long tell() const;
00129
00133 long length();
00134
00138 void truncate(long length);
00139
00140 protected:
00141
00145 static unsigned int bufferSize();
00146
00147 private:
00148 class FileStreamPrivate;
00149 FileStreamPrivate *d;
00150 };
00151
00152 }
00153
00154 #endif