]> source.dussan.org Git - tigervnc.git/commitdiff
Added SFTMsgReader and SFTMsgWriter classes to the rfb project.
authorDennis Syrovatsky <dennis@tightvnc.com>
Sun, 18 Dec 2005 14:24:06 +0000 (14:24 +0000)
committerDennis Syrovatsky <dennis@tightvnc.com>
Sun, 18 Dec 2005 14:24:06 +0000 (14:24 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@462 3789f03b-4d11-0410-bbf8-ca57d06f2519

rfb/SFTMsgReader.cxx [new file with mode: 0644]
rfb/SFTMsgReader.h [new file with mode: 0644]
rfb/SFTMsgWriter.cxx [new file with mode: 0644]
rfb/SFTMsgWriter.h [new file with mode: 0644]
rfb/rfb.dsp

diff --git a/rfb/SFTMsgReader.cxx b/rfb/SFTMsgReader.cxx
new file mode 100644 (file)
index 0000000..2ff437b
--- /dev/null
@@ -0,0 +1,104 @@
+/* Copyright (C) 2005 TightVNC Team.  All Rights Reserved.
+ *    
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
+ * USA.
+ *
+ * TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+ *
+ */
+
+// -=- SFTMsgReader.cxx
+
+#include <rfb/SFTMsgReader.h>
+
+using namespace rfb;
+
+SFTMsgReader::SFTMsgReader(rdr::InStream *pIS)
+{
+  m_pIS = pIS;
+}
+
+SFTMsgReader::~SFTMsgReader()
+{
+}
+    
+bool 
+SFTMsgReader::readFileListRqst(unsigned int *pDirNameSize, char *pDirName, 
+                               unsigned int *pFlags, bool *bDirOnly)
+{
+  return false;
+}
+    
+bool 
+SFTMsgReader::readFileDownloadRqst(unsigned int *pFilenameSize, char *pFilename, 
+                                   unsigned int *pPosition)
+{
+  return false;
+}
+
+bool 
+SFTMsgReader::readFileUploadRqst(unsigned int *pFilenameSize, char *pFilename, 
+                                 unsigned int *pPosition)
+{
+  return false;
+}
+    
+void *
+SFTMsgReader::readFileUploadData(unsigned int *pDataSize, unsigned int *pModTime)
+{
+  return NULL;
+}
+    
+bool 
+SFTMsgReader::readFileCreateDirRqst(unsigned int *pDirNameSize, char *pDirName)
+{
+  return false;
+}
+
+bool 
+SFTMsgReader::readFileDirSizeRqst(unsigned int *pDirNameSize, char *pDirName)
+{
+  return false;
+}
+
+bool 
+SFTMsgReader::readFileDeleteRqst(unsigned int *pNameSize, char *pName)
+{
+  return false;
+}
+    
+bool readFileRenameRqst(unsigned int *pOldNameSize, unsigned int *pNewNameSize,
+                        char *pOldName, char *pNewName)
+{
+  return false;
+}
+
+char *
+SFTMsgReader::readFileDownloadCancel(unsigned int *pReasonSize)
+{
+  return NULL;
+}
+
+char *
+SFTMsgReader::readFileUploadFailed(unsigned int *pReasonSize)
+{
+  return NULL;
+}
+
+bool 
+SFTMsgReader::readU8U16StringMsg(unsigned int *pReasonSize, char *pReason)
+{
+  return false;
+}
diff --git a/rfb/SFTMsgReader.h b/rfb/SFTMsgReader.h
new file mode 100644 (file)
index 0000000..d253645
--- /dev/null
@@ -0,0 +1,66 @@
+/* Copyright (C) 2005 TightVNC Team.  All Rights Reserved.
+ *    
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
+ * USA.
+ *
+ * TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+ *
+ */
+
+// -=- SFTMsgReader.h
+
+#ifndef __RFB_SFTMSGREADER_H__
+#define __RFB_SFTMSGREADER_H__
+
+#include <rdr/InStream.h>
+
+namespace rfb {
+  class SFTMsgReader
+  {
+  public:
+    SFTMsgReader(rdr::InStream *pIS);
+    ~SFTMsgReader();
+    
+    bool readFileListRqst(unsigned int *pDirNameSize, char *pDirName, 
+                          unsigned int *pFlags, bool *bDirOnly);
+    
+    
+    bool readFileDownloadRqst(unsigned int *pFilenameSize, char *pFilename, 
+                              unsigned int *pPosition);
+
+    bool readFileUploadRqst(unsigned int *pFilenameSize, char *pFilename, 
+                            unsigned int *pPosition);
+    
+    void *readFileUploadData(unsigned int *pDataSize, unsigned int *pModTime);
+
+    
+    bool readFileCreateDirRqst(unsigned int *pDirNameSize, char *pDirName);
+    bool readFileDirSizeRqst(unsigned int *pDirNameSize, char *pDirName);
+    bool readFileDeleteRqst(unsigned int *pNameSize, char *pName);
+    
+    bool readFileRenameRqst(unsigned int *pOldNameSize, unsigned int *pNewNameSize,
+                            char *pOldName, char *pNewName);
+
+    char *readFileDownloadCancel(unsigned int *pReasonSize);
+    char *readFileUploadFailed(unsigned int *pReasonSize);
+
+  private:
+    rdr::InStream *m_pIS;
+
+    bool readU8U16StringMsg(unsigned int *pReasonSize, char *pReason);
+  };
+}
+
+#endif // __RFB_SFTMSGREADER_H__
diff --git a/rfb/SFTMsgWriter.cxx b/rfb/SFTMsgWriter.cxx
new file mode 100644 (file)
index 0000000..e74775e
--- /dev/null
@@ -0,0 +1,86 @@
+/* Copyright (C) 2005 TightVNC Team.  All Rights Reserved.
+ *    
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
+ * USA.
+ *
+ * TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+ *
+ */
+
+// -=- SFTMsgWriter.cxx
+
+#include <rfb/SFTMsgWriter.h>
+
+using namespace rfb;
+
+SFTMsgWriter::SFTMsgWriter(rdr::OutStream *pOS)
+{
+  m_pOS = pOS;
+}
+
+SFTMsgWriter::~SFTMsgWriter()
+{
+}
+    
+bool 
+SFTMsgWriter::writeFileListData(unsigned char flags, rfb::FileInfo *pFileInfo)
+{
+  return false;
+}
+
+bool 
+SFTMsgWriter::writeFileDownloadData(unsigned int dataSize, void *pData)
+{
+  return false;
+}
+
+bool 
+SFTMsgWriter::writeFileDownloadData(unsigned int modTime)
+{
+  return false;
+}
+
+bool
+SFTMsgWriter::writeFileUploadCancel(unsigned int reasonLen, char *pReason)
+{
+  return false;
+}
+
+bool 
+SFTMsgWriter::writeFileDownloadFailed(unsigned int reasonLen, char *pReason)
+{
+  return false;
+}
+
+bool 
+SFTMsgWriter::writeFileDirSizeData(unsigned int dirSizeLow, 
+                                   unsigned short dirSizeHigh)
+{
+  return false;
+}
+
+bool 
+SFTMsgWriter::writeFileLastRqstFailed(unsigned char lastRequest, 
+                                      unsigned short reasonLen,
+                                      char *pReason)
+{
+  return false;
+}
+
+bool
+SFTMsgWriter::writeU8U16StringMsg(unsigned char p1, unsigned short p2, char *pP3)
+{
+  return false;
+}
diff --git a/rfb/SFTMsgWriter.h b/rfb/SFTMsgWriter.h
new file mode 100644 (file)
index 0000000..ba5bf1c
--- /dev/null
@@ -0,0 +1,53 @@
+/* Copyright (C) 2005 TightVNC Team.  All Rights Reserved.
+ *    
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
+ * USA.
+ *
+ * TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+ *
+ */
+
+// -=- SFTMsgWriter.h
+
+#ifndef __RFB_SFTMSGWRITER_H__
+#define __RFB_SFTMSGWRITER_H__
+
+#include <rdr/OutStream.h>
+#include <rfb/FileInfo.h>
+
+namespace rfb {
+  class SFTMsgWriter
+  {
+  public:
+    SFTMsgWriter(rdr::OutStream *pOS);
+    ~SFTMsgWriter();
+    
+    bool writeFileListData(unsigned char flags, rfb::FileInfo *pFileInfo);
+    bool writeFileDownloadData(unsigned int dataSize, void *pData);
+    bool writeFileDownloadData(unsigned int modTime);
+    bool writeFileUploadCancel(unsigned int reasonLen, char *pReason);
+    bool writeFileDownloadFailed(unsigned int reasonLen, char *pReason);
+    bool writeFileDirSizeData(unsigned int dirSizeLow, unsigned short dirSizeHigh);
+    bool writeFileLastRqstFailed(unsigned char lastRequest, unsigned short reasonLen, 
+                                 char *pReason);
+
+  private:
+    rdr::OutStream *m_pOS;
+
+    bool writeU8U16StringMsg(unsigned char p1, unsigned short p2, char *pP3);
+  };
+}
+
+#endif // __RFB_SFTMSGWRITER_H__
index 15f75aff909d055af2beb11fdf63352a0be36a27..42da641a05256a10dd2bf19e120b3bef5927f525 100644 (file)
@@ -262,6 +262,14 @@ SOURCE=.\ServerCore.cxx
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=.\SFTMsgReader.cxx\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\SFTMsgWriter.cxx\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=.\SMsgHandler.cxx\r
 # End Source File\r
 # Begin Source File\r
@@ -584,6 +592,14 @@ SOURCE=.\ServerCore.h
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=.\SFTMsgReader.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\SFTMsgWriter.h\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=.\SMsgHandler.h\r
 # End Source File\r
 # Begin Source File\r