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_IOSTREAM_H
00027 #define TAGLIB_IOSTREAM_H
00028
00029 #include "taglib_export.h"
00030 #include "taglib.h"
00031 #include "tbytevector.h"
00032
00033 namespace TagLib {
00034
00035 #ifdef _WIN32
00036 class TAGLIB_EXPORT FileName
00037 {
00038 public:
00039 FileName(const wchar_t *name);
00040 FileName(const char *name);
00041
00042 FileName(const FileName &name);
00043
00044 operator const wchar_t *() const;
00045 operator const char *() const;
00046
00047 const std::wstring &wstr() const;
00048 const std::string &str() const;
00049
00050 String toString() const;
00051
00052 private:
00053 const std::string m_name;
00054 const std::wstring m_wname;
00055 };
00056 #else
00057 typedef const char *FileName;
00058 #endif
00059
00061
00062 class TAGLIB_EXPORT IOStream
00063 {
00064 public:
00068 enum Position {
00070 Beginning,
00072 Current,
00074 End
00075 };
00076
00077 IOStream();
00078
00082 virtual ~IOStream();
00083
00087 virtual FileName name() const = 0;
00088
00092 virtual ByteVector readBlock(ulong length) = 0;
00093
00103 virtual void writeBlock(const ByteVector &data) = 0;
00104
00112 virtual void insert(const ByteVector &data, ulong start = 0, ulong replace = 0) = 0;
00113
00121 virtual void removeBlock(ulong start = 0, ulong length = 0) = 0;
00122
00126 virtual bool readOnly() const = 0;
00127
00132 virtual bool isOpen() const = 0;
00133
00140 virtual void seek(long offset, Position p = Beginning) = 0;
00141
00145 virtual void clear();
00146
00150 virtual long tell() const = 0;
00151
00155 virtual long length() = 0;
00156
00160 virtual void truncate(long length) = 0;
00161
00162 private:
00163 IOStream(const IOStream &);
00164 IOStream &operator=(const IOStream &);
00165 };
00166
00167 }
00168
00169 #endif