summaryrefslogtreecommitdiff
path: root/indra/llmessage/lltransfertargetfile.h
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2007-01-02 08:33:20 +0000
committerJames Cook <james@lindenlab.com>2007-01-02 08:33:20 +0000
commit420b91db29485df39fd6e724e782c449158811cb (patch)
treeb471a94563af914d3ed3edd3e856d21cb1b69945 /indra/llmessage/lltransfertargetfile.h
Print done when done.
Diffstat (limited to 'indra/llmessage/lltransfertargetfile.h')
-rw-r--r--indra/llmessage/lltransfertargetfile.h53
1 files changed, 53 insertions, 0 deletions
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 <stdio.h>
+
+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 &params);
+ /*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