lltransfersourcefile.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLTRANSFERSOURCEFILE_H
00033 #define LL_LLTRANSFERSOURCEFILE_H
00034 
00035 #include "lltransfermanager.h"
00036 
00037 class LLTransferSourceParamsFile : public LLTransferSourceParams
00038 {
00039 public:
00040         LLTransferSourceParamsFile();
00041         virtual ~LLTransferSourceParamsFile() {}
00042         /*virtual*/ void packParams(LLDataPacker &dp) const;
00043         /*virtual*/ BOOL unpackParams(LLDataPacker &dp);
00044 
00045         void setFilename(const LLString &filename)              { mFilename = filename; }
00046         std::string getFilename() const                                 { return mFilename; }
00047 
00048         void setDeleteOnCompletion(BOOL enabled)                { mDeleteOnCompletion = enabled; }
00049         BOOL getDeleteOnCompletion()                                    { return mDeleteOnCompletion; }
00050 protected:
00051         std::string mFilename;
00052         // ONLY DELETE THINGS OFF THE SIM IF THE FILENAME BEGINS IN 'TEMP'
00053         BOOL mDeleteOnCompletion;
00054 };
00055 
00056 class LLTransferSourceFile : public LLTransferSource
00057 {
00058 public:
00059         LLTransferSourceFile(const LLUUID &transfer_id, const F32 priority);
00060         virtual ~LLTransferSourceFile();
00061 
00062 protected:
00063         /*virtual*/ void initTransfer();
00064         /*virtual*/ F32 updatePriority();
00065         /*virtual*/ LLTSCode dataCallback(const S32 packet_id,
00066                                                                           const S32 max_bytes,
00067                                                                           U8 **datap,
00068                                                                           S32 &returned_bytes,
00069                                                                           BOOL &delete_returned);
00070         /*virtual*/ void completionCallback(const LLTSCode status);
00071 
00072         virtual void packParams(LLDataPacker& dp) const;
00073         /*virtual*/ BOOL unpackParams(LLDataPacker &dp);
00074 
00075 protected:
00076         LLTransferSourceParamsFile mParams;
00077         FILE *mFP;
00078 };
00079 
00080 #endif // LL_LLTRANSFERSOURCEFILE_H

Generated on Thu Jul 1 06:09:23 2010 for Second Life Viewer by  doxygen 1.4.7