2 #ifndef _QICORE_FILE_HPP_
3 #define _QICORE_FILE_HPP_
13 #include <qi/anyobject.hpp>
14 #include <qi/path.hpp>
15 #include <qi/future.hpp>
16 #include <qi/buffer.hpp>
17 #include <qi/property.hpp>
19 #include <boost/shared_ptr.hpp>
63 virtual bool isRunning()
const = 0;
69 virtual void _reset() = 0;
72 virtual void _notifyRunning() = 0;
75 virtual void _notifyFinished() = 0;
78 virtual void _notifyCancelled() = 0;
81 virtual void _notifyFailed() = 0;
90 virtual void _notifyProgressed(
double newProgress) = 0;
117 virtual std::streamsize size()
const = 0;
120 virtual bool isOpen()
const = 0;
123 virtual bool isRemote()
const = 0;
136 static const std::streamsize MAX_READ_SIZE = 1000000;
149 virtual Buffer _read(std::streamsize countBytesToRead) = 0;
165 virtual Buffer _read(std::streamoff beginOffset, std::streamsize countBytesToRead) = 0;
174 virtual bool _seek(std::streamoff offsetFromBegin) = 0;
181 virtual void _close() = 0;
209 virtual Future<void>
start() = 0;
240 #endif // _QI_FILE_HPP_
Property< double > progress
QI_TYPE_ENUM_REGISTER(ProgressNotifier::Status)
Property< Status > status
FileOperationPtr prepareCopyToLocal(FilePtr file, const Path &localPath)
The operation has been canceled by the user.
ProgressNotifierPtr createProgressNotifier()
boost::shared_ptr< FileOperation > FileOperationPtr
Pointer to a file operation.
The operation has failed.
virtual Future< void > start()=0
The operation finished successfully.
qi::Object< ProgressNotifier > ProgressNotifierPtr
Pointer to a ProgressNotifier with shared/remote semantic.
The operation is currently running.
FutureSync< void > copyToLocal(FilePtr file, const Path &localPath)
qi::Object< File > FilePtr
Pointer to a file with shared/remote semantic.
virtual ~ProgressNotifier()
FilePtr openLocalFile(const qi::Path &localPath)
The operation has not start yet.