diff options
author | James Cook <james@lindenlab.com> | 2007-01-02 08:33:20 +0000 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2007-01-02 08:33:20 +0000 |
commit | 420b91db29485df39fd6e724e782c449158811cb (patch) | |
tree | b471a94563af914d3ed3edd3e856d21cb1b69945 /indra/llmessage/lltransfersourcefile.h |
Print done when done.
Diffstat (limited to 'indra/llmessage/lltransfersourcefile.h')
-rw-r--r-- | indra/llmessage/lltransfersourcefile.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/indra/llmessage/lltransfersourcefile.h b/indra/llmessage/lltransfersourcefile.h new file mode 100644 index 0000000000..ecaa6c908a --- /dev/null +++ b/indra/llmessage/lltransfersourcefile.h @@ -0,0 +1,58 @@ +/** + * @file lltransfersourcefile.h + * @brief Transfer system for sending a file. + * + * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#ifndef LL_LLTRANSFERSOURCEFILE_H +#define LL_LLTRANSFERSOURCEFILE_H + +#include "lltransfermanager.h" + +#include <stdio.h> + +class LLTransferSourceParamsFile : public LLTransferSourceParams +{ +public: + LLTransferSourceParamsFile(); + virtual ~LLTransferSourceParamsFile() {} + /*virtual*/ void packParams(LLDataPacker &dp) const; + /*virtual*/ BOOL unpackParams(LLDataPacker &dp); + + void setFilename(const LLString &filename) { mFilename = filename; } + std::string getFilename() const { return mFilename; } + + void setDeleteOnCompletion(BOOL enabled) { mDeleteOnCompletion = enabled; } + BOOL getDeleteOnCompletion() { return mDeleteOnCompletion; } +protected: + std::string mFilename; + // ONLY DELETE THINGS OFF THE SIM IF THE FILENAME BEGINS IN 'TEMP' + BOOL mDeleteOnCompletion; +}; + +class LLTransferSourceFile : public LLTransferSource +{ +public: + LLTransferSourceFile(const LLUUID &transfer_id, const F32 priority); + virtual ~LLTransferSourceFile(); + +protected: + /*virtual*/ void initTransfer(); + /*virtual*/ F32 updatePriority(); + /*virtual*/ LLTSCode dataCallback(const S32 packet_id, + const S32 max_bytes, + U8 **datap, + S32 &returned_bytes, + BOOL &delete_returned); + /*virtual*/ void completionCallback(const LLTSCode status); + + /*virtual*/ BOOL unpackParams(LLDataPacker &dp); + +protected: + LLTransferSourceParamsFile mParams; + FILE *mFP; +}; + +#endif // LL_LLTRANSFERSOURCEFILE_H |