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(unsigned long length) = 0;
00093
00103 virtual void writeBlock(const ByteVector &data) = 0;
00104
00112 virtual void insert(const ByteVector &data,
00113 unsigned long start = 0, unsigned long replace = 0) = 0;
00114
00122 virtual void removeBlock(unsigned long start = 0, unsigned long length = 0) = 0;
00123
00127 virtual bool readOnly() const = 0;
00128
00133 virtual bool isOpen() const = 0;
00134
00141 virtual void seek(long offset, Position p = Beginning) = 0;
00142
00146 virtual void clear();
00147
00151 virtual long tell() const = 0;
00152
00156 virtual long length() = 0;
00157
00161 virtual void truncate(long length) = 0;
00162
00163 private:
00164 IOStream(const IOStream &);
00165 IOStream &operator=(const IOStream &);
00166 };
00167
00168 }
00169
00170 #endif