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