⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 warfiledriverfile.h

📁 ftpserver very good sample
💻 H
字号:
/** */#ifndef WAR_FILE_DRIVER_FILE_H#define WAR_FILE_DRIVER_FILE_H/* SYSTEM INCLUDES *//* PROJECT INCLUDES */#ifndef WAR_TYPES_H#   include "WarTypes.h"#endif#ifndef WAR_EXCEPTION_H#   include "WarException.h"#endif#ifndef WAR_SMART_POINTER_H#   include "WarSmartPointer.h"#endif#ifndef WAR_PTR_WRAPPER_H#   include "WarPtrWrapper.h"#endif#ifndef WAR_PATH_H#   include "WarPath.h"#endif#ifndef WAR_URL_H#   include "WarUrl.h"#endif#ifndef WAR_FILE_ENUMS#   include "WarFileEnums.h"#endif#ifndef WAR_FILE_CALLBACK_H#   include "WarFileCallback.h"#endif#ifndef WAR_DIRLIST_H#   include "WarDirList.h"#endif/* LOCAL INCLUDES *//* FORWARD REFERENCES */class WarFileDriver;class WarFile;#ifdef __cplusplusextern "C" {#endif/****************** BEGIN OLD STYLE C spesific ********//****************** END OLD STYLE C spesific **********/#ifdef __cplusplus }#endif/****************** BEGIN C++ spesific ****************/#ifdef __cplusplusclass WarFileDriverFile : public WarFileEnums{public:    // LIFECYCLE     ///    WarFileDriverFile(WarFileDriver *pDriver);        ///    virtual ~WarFileDriverFile();    // OPERATORS    // OPERATIONS           ///    virtual void Open(const WarUrl& openUrl,         war_uint32_t openFlags)         throw(WarException) = 0;    virtual void Close() throw(WarException) = 0;    ///    virtual war_uint32_t Read(war_cptr_t Buf,         war_uint32_t bytes)         throw(WarException)= 0;    virtual void ReadWithCallback(        WarFileCallback& callback)        throw(WarException)    {        WarThrow(WarError(WAR_ERR_NOT_IMPLEMENTED), NULL);    }    ///    virtual void WriteWithCallback(war_transfer_buffer_ptr_t& outBuffer)        throw(WarException)    {        WarThrow(WarError(WAR_ERR_NOT_IMPLEMENTED), NULL);    }    ///    virtual void ReadWithCallback(war_transfer_buffer_ptr_t& inBuffer)        throw(WarException)    {        WarThrow(WarError(WAR_ERR_NOT_IMPLEMENTED), NULL);    }    ///    virtual void Write (war_ccptr_t Buf,         war_uint32_t bytes)         throw(WarException)    {        WarThrow(WarError(WAR_ERR_NOT_IMPLEMENTED), NULL);    }    ///    virtual void Flush() throw(WarException) = 0;    ///    virtual war_flen_t Seek(war_flen_t fileOffset,         SeekModes seekMode = WAR_SEEK_BEGIN)         throw(WarException)= 0;        ///    virtual const war_uint32_t GetFlags() const throw(WarException)    {        return mFlags;    }    /** Gives the driver the final word about      * FTP transfer buffer sizes, after the      * sizes are set by the default option       * settings.      */    virtual void OnFtpBufferSize(int& numBuffers,        int& bufferSize,        int& numSegments)    {        return;    }    // ACCESS    /* Get a handle to the system handle for the     * file. Only guaranteed to work on native     * files */    virtual war_filehandle_t GetHandle()        throw(WarException)    {        WarThrow(WarError(WAR_ERR_NOT_IMPLEMENTED), NULL);    }    WarFileDriver& GetDriver()         throw(WarException)    {        if (!mpDriver)            WarThrow(WarError(WAR_ERR_INTERNAL_DATA_NOT_INITIALIZED), NULL);        return *mpDriver;    }    // INQUIRY    virtual war_flen_t GetLength() throw(WarException);    ///    virtual war_flen_t GetPosition() throw(WarException);    ///    virtual bool IsEof() throw(WarException);    ///    virtual bool IsOpen() throw(WarException);    /** Returns true if the driver supports       * ReadWithCallback and WriteWithCallback      */    virtual bool CanDoCallback() const { return false; }    /** Get the file name        This function can return the file name, pathname        URL, type etc.    */    template <class charT, class slashT>    void GetFileName(WarPath<charT, slashT>& rPath,        NameModes nameMode = NAME_LOGICAL_NAME_ONLY)        throw(WarException)    {        WarThrow(WarError(WAR_ERR_NOT_IMPLEMENTED), NULL);    };    protected:    virtual void OnRead(const WarError& status,         war_transfer_buffer_ptr_t& buffer)        throw(WarException);    virtual void OnWritten(const WarError& status,        war_transfer_buffer_ptr_t& buffer)        throw(WarException);    friend class WarFile;    war_uint32_t mFlags;    WarFileDriver *mpDriver;    WarFile *mpCompanion;private:};/* INLINE METHODS *//* EXTERNAL REFERENCES */#endif /* __cplusplus *//****************** END C++ spesific ******************/#endif  /* WAR_FILE_DRIVER_FILE_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -