blob: 173253b5cd4d6d4db360849de9e4484af6ac0a22 [file] [log] [blame]
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00001/* Copyright (C) 2005 TightVNC Team. All Rights Reserved.
2 *
3 * Developed by Dennis Syrovatsky.
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18 * USA.
19 *
Peter Åstrand7877cd62009-02-25 16:15:48 +000020 *
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000021 *
22 */
23
24// -=- SFTMsgReader.h
25
26#ifndef __RFB_SFTMSGREADER_H__
27#define __RFB_SFTMSGREADER_H__
28
29#include <rdr/InStream.h>
30#include <rfb/fttypes.h>
31
32namespace rfb {
33 class SFTMsgReader
34 {
35 public:
36 SFTMsgReader(rdr::InStream *pIS);
37 ~SFTMsgReader();
38
39 bool readFileListRqst(unsigned int *pDirNameSize, char *pDirName,
40 unsigned int *pFlags);
41
42
43 bool readFileDownloadRqst(unsigned int *pFilenameSize, char *pFilename,
44 unsigned int *pPosition);
45
46 bool readFileUploadRqst(unsigned int *pFilenameSize, char *pFilename,
47 unsigned int *pPosition);
48
49 char *readFileUploadData(unsigned int *pDataSize, unsigned int *pModTime);
50
51
52 bool readFileCreateDirRqst(unsigned int *pDirNameSize, char *pDirName);
53 bool readFileDirSizeRqst(unsigned int *pDirNameSize, char *pDirName);
54 bool readFileDeleteRqst(unsigned int *pNameSize, char *pName);
55
56 bool readFileRenameRqst(unsigned int *pOldNameSize, unsigned int *pNewNameSize,
57 char *pOldName, char *pNewName);
58
59 bool readFileDownloadCancel(unsigned int *pReasonSize, char *pReason);
60 bool readFileUploadFailed(unsigned int *pReasonSize, char *pReason);
61
62 private:
63 rdr::InStream *m_pIS;
64
65 bool readU8U16StringMsg(unsigned int *pReasonSize, char *pReason);
66 bool readU8U16U32StringMsg(unsigned char *pU8, unsigned int *pU16,
67 unsigned int *pU32, char *pString);
68 };
69}
70
71#endif // __RFB_SFTMSGREADER_H__