PageRenderTime 16ms CodeModel.GetById 8ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llmessage/llxfer_file.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 85 lines | 40 code | 20 blank | 25 comment | 0 complexity | 05f93d79069f7c047213cae206fe30a4 MD5 | raw file
 1/** 
 2 * @file llxfer_file.h
 3 * @brief definition of LLXfer_File class for a single xfer_file.
 4 *
 5 * $LicenseInfo:firstyear=2001&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLXFER_FILE_H
28#define LL_LLXFER_FILE_H
29
30#include "llxfer.h"
31#include "lldir.h"
32
33class LLXfer_File : public LLXfer
34{
35 protected:
36 	LLFILE *mFp;
37	std::string mLocalFilename;
38	std::string mRemoteFilename;
39	ELLPath mRemotePath;
40	std::string mTempFilename;
41
42	BOOL mDeleteLocalOnCompletion;
43	BOOL mDeleteRemoteOnCompletion;
44
45 public:
46	LLXfer_File (S32 chunk_size);
47	LLXfer_File (const std::string& local_filename, BOOL delete_local_on_completion, S32 chunk_size);
48	virtual ~LLXfer_File();
49
50	virtual void init(const std::string& local_filename, BOOL delete_local_on_completion, S32 chunk_size);
51	virtual void cleanup();
52
53	virtual S32 initializeRequest(U64 xfer_id,
54								  const std::string& local_filename,
55								  const std::string& remote_filename,
56								  ELLPath remote_path,
57								  const LLHost& remote_host,
58								  BOOL delete_remote_on_completion,
59								  void (*callback)(void**,S32,LLExtStat),
60								  void** user_data);
61	virtual S32 startDownload();
62
63	virtual S32 processEOF();
64	
65	virtual S32 startSend (U64 xfer_id, const LLHost &remote_host);
66
67	virtual S32 suck(S32 start_position);
68	virtual S32 flush();
69
70	virtual BOOL matchesLocalFilename(const std::string& filename);
71	virtual BOOL matchesRemoteFilename(const std::string& filename, ELLPath remote_path);
72
73	virtual S32  getMaxBufferSize();
74
75	virtual U32 getXferTypeTag();
76
77	virtual std::string getFileName();
78};
79
80#endif
81
82
83
84
85