PageRenderTime 38ms CodeModel.GetById 23ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1
  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. #ifndef LL_LLXFER_FILE_H
  27. #define LL_LLXFER_FILE_H
  28. #include "llxfer.h"
  29. #include "lldir.h"
  30. class LLXfer_File : public LLXfer
  31. {
  32. protected:
  33. LLFILE *mFp;
  34. std::string mLocalFilename;
  35. std::string mRemoteFilename;
  36. ELLPath mRemotePath;
  37. std::string mTempFilename;
  38. BOOL mDeleteLocalOnCompletion;
  39. BOOL mDeleteRemoteOnCompletion;
  40. public:
  41. LLXfer_File (S32 chunk_size);
  42. LLXfer_File (const std::string& local_filename, BOOL delete_local_on_completion, S32 chunk_size);
  43. virtual ~LLXfer_File();
  44. virtual void init(const std::string& local_filename, BOOL delete_local_on_completion, S32 chunk_size);
  45. virtual void cleanup();
  46. virtual S32 initializeRequest(U64 xfer_id,
  47. const std::string& local_filename,
  48. const std::string& remote_filename,
  49. ELLPath remote_path,
  50. const LLHost& remote_host,
  51. BOOL delete_remote_on_completion,
  52. void (*callback)(void**,S32,LLExtStat),
  53. void** user_data);
  54. virtual S32 startDownload();
  55. virtual S32 processEOF();
  56. virtual S32 startSend (U64 xfer_id, const LLHost &remote_host);
  57. virtual S32 suck(S32 start_position);
  58. virtual S32 flush();
  59. virtual BOOL matchesLocalFilename(const std::string& filename);
  60. virtual BOOL matchesRemoteFilename(const std::string& filename, ELLPath remote_path);
  61. virtual S32 getMaxBufferSize();
  62. virtual U32 getXferTypeTag();
  63. virtual std::string getFileName();
  64. };
  65. #endif