From 420b91db29485df39fd6e724e782c449158811cb Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 2 Jan 2007 08:33:20 +0000 Subject: Print done when done. --- indra/llmessage/lltransfertargetfile.h | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 indra/llmessage/lltransfertargetfile.h (limited to 'indra/llmessage/lltransfertargetfile.h') diff --git a/indra/llmessage/lltransfertargetfile.h b/indra/llmessage/lltransfertargetfile.h new file mode 100644 index 0000000000..63cc21262b --- /dev/null +++ b/indra/llmessage/lltransfertargetfile.h @@ -0,0 +1,53 @@ +/** + * @file lltransfertargetfile.h + * @brief Transfer system for receiving a file. + * + * Copyright (c) 2006-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#ifndef LL_LLTRANSFERTARGETFILE_H +#define LL_LLTRANSFERTARGETFILE_H + +#include "lltransfermanager.h" + +#include + +typedef void (*LLTTFCompleteCallback)(const LLTSCode status, void *user_data); + +class LLTransferTargetParamsFile : public LLTransferTargetParams +{ +public: + LLTransferTargetParamsFile() : LLTransferTargetParams(LLTTT_FILE) {} + void setFilename(const char *filename) { mFilename = filename; } + void setCallback(LLTTFCompleteCallback cb, void *user_data) { mCompleteCallback = cb; mUserData = user_data; } + + friend class LLTransferTargetFile; +protected: + LLString mFilename; + LLTTFCompleteCallback mCompleteCallback; + void * mUserData; +}; + + +class LLTransferTargetFile : public LLTransferTarget +{ +public: + LLTransferTargetFile(const LLUUID &uuid); + virtual ~LLTransferTargetFile(); + + static void requestTransfer(LLTransferTargetChannel *channelp, + const char *local_filename, + const LLTransferSourceParams &source_params, + LLTTFCompleteCallback callback); +protected: + /*virtual*/ void applyParams(const LLTransferTargetParams ¶ms); + /*virtual*/ LLTSCode dataCallback(const S32 packet_id, U8 *in_datap, const S32 in_size); + /*virtual*/ void completionCallback(const LLTSCode status); + + LLTransferTargetParamsFile mParams; + + FILE *mFP; +}; + +#endif // LL_LLTRANSFERTARGETFILE_H -- cgit v1.2.3