Small code improvements.
Added FileInfo class. This class was moved from TightVNC.1.3.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@343 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/rfb/FileManager.cxx b/rfb/FileManager.cxx
index 6fa5eef..bcc1281 100644
--- a/rfb/FileManager.cxx
+++ b/rfb/FileManager.cxx
@@ -14,49 +14,52 @@
* 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/
+ *
*/
// -=- FileManager.cxx
-#include "FileManager.h"
+#include <rfb/FileManager.h>
using namespace rfb;
FileManager::FileManager()
{
- m_pFile = NULL;
+ m_pFile = NULL;
}
FileManager::~FileManager()
{
- close();
+ close();
}
bool
FileManager::create()
{
- if (m_pFile != NULL) return false;
-
- m_pFile = fopen(m_szFilename, m_szMode);
-
- if (m_pFile == NULL) {
- return false;
- } else {
- return true;
- }
+ if (m_pFile != NULL) return false;
+
+ m_pFile = fopen(m_szFilename, m_szMode);
+
+ if (m_pFile == NULL) {
+ return false;
+ } else {
+ return true;
+ }
}
bool
FileManager::close()
{
- if (m_pFile == NULL) return false;
-
- int result = fclose(m_pFile);
-
- if (result != 0) {
- return false;
- } else {
- m_pFile = NULL;
- return true;
- }
+ if (m_pFile == NULL) return false;
+
+ int result = fclose(m_pFile);
+
+ if (result != 0) {
+ return false;
+ } else {
+ m_pFile = NULL;
+ return true;
+ }
}
diff --git a/rfb/FileManager.h b/rfb/FileManager.h
index 8638d66..0787173 100644
--- a/rfb/FileManager.h
+++ b/rfb/FileManager.h
@@ -14,6 +14,9 @@
* 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/
+ *
*/
// -=- FileManager.
@@ -21,21 +24,21 @@
#ifndef __RFB_FILEMANAGER_H__
#define __RFB_FILEMANAGER_H__
-#include "rfb/fttypes.h"
+#include <rfb/fttypes.h>
namespace rfb {
- class FileManager {
- public:
- FileManager();
- ~FileManager();
-
- bool create();
- bool close();
-
- protected:
- FILE *m_pFile;
- char m_szMode[4];
- char m_szFilename[FT_FILENAME_SIZE];
- };
+ class FileManager {
+ public:
+ FileManager();
+ ~FileManager();
+
+ bool create();
+ bool close();
+
+ protected:
+ FILE *m_pFile;
+ char m_szMode[4];
+ char m_szFilename[FT_FILENAME_SIZE];
+ };
}
#endif // __RFB_FILEMANAGER_H__
\ No newline at end of file
diff --git a/rfb/FileReader.cxx b/rfb/FileReader.cxx
index a74a517..23d2756 100644
--- a/rfb/FileReader.cxx
+++ b/rfb/FileReader.cxx
@@ -14,11 +14,14 @@
* 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/
+ *
*/
// -=- FileReader.cxx
-#include "FileReader.h"
+#include <rfb/FileReader.h>
using namespace rfb;
diff --git a/rfb/FileReader.h b/rfb/FileReader.h
index 50a52af..fe58115 100644
--- a/rfb/FileReader.h
+++ b/rfb/FileReader.h
@@ -14,6 +14,9 @@
* 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/
+ *
*/
// -=- FileReader.h
@@ -21,7 +24,7 @@
#ifndef __RFB_FILEREADER_H__
#define __RFB_FILEREADER_H__
-#include "FileManager.h"
+#include <rfb/FileManager.h>
namespace rfb {
class FileReader : public FileManager {
diff --git a/rfb/FileWriter.cxx b/rfb/FileWriter.cxx
index cc2942d..4ad285b 100644
--- a/rfb/FileWriter.cxx
+++ b/rfb/FileWriter.cxx
@@ -14,11 +14,14 @@
* 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/
+ *
*/
// -=- FileWriter.cxx
-#include "FileWriter.h"
+#include <rfb/FileWriter.h>
using namespace rfb;
diff --git a/rfb/FileWriter.h b/rfb/FileWriter.h
index bb261a7..5e168dd 100644
--- a/rfb/FileWriter.h
+++ b/rfb/FileWriter.h
@@ -14,6 +14,9 @@
* 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/
+ *
*/
// -=- FileWriter.h
@@ -21,7 +24,7 @@
#ifndef __RFB_FILEWRITER_H__
#define __RFB_FILEWRITER_H__
-#include "FileManager.h"
+#include <rfb/FileManager.h>
namespace rfb {
class FileWriter : public FileManager {
diff --git a/rfb/fttypes.h b/rfb/fttypes.h
index e2e3039..eae3d98 100644
--- a/rfb/fttypes.h
+++ b/rfb/fttypes.h
@@ -16,10 +16,45 @@
* USA.
*/
-// -=- CommonTypes.h
+// -=- fttypes.h
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
-#define FT_FILENAME_SIZE 256
\ No newline at end of file
+#define FT_FILENAME_SIZE 256
+
+#define FT_MAX_STATUS_STRINGS 255
+#define FT_MAX_LENGTH_STATUS_STRINGS 130
+
+#define FT_ATTR_UNKNOWN 0x00000000
+#define FT_ATTR_FILE 0x00000001
+#define FT_ATTR_FOLDER 0x00000002
+
+typedef struct tagSIZEDATAINFO
+{
+ unsigned int size;
+ unsigned int data;
+} SIZEDATAINFO;
+
+typedef struct tagSIZEDATAFLAGSINFO
+{
+ unsigned int size;
+ unsigned int data;
+ unsigned int flags;
+} SIZEDATAFLAGSINFO;
+
+typedef struct tagFILEINFO
+{
+ char name[FT_FILENAME_SIZE];
+ SIZEDATAFLAGSINFO info;
+} FILEINFO;
+
+typedef struct tagFILEINFOEX
+{
+ char locPath[FT_FILENAME_SIZE];
+ char locName[FT_FILENAME_SIZE];
+ char remPath[FT_FILENAME_SIZE];
+ char remName[FT_FILENAME_SIZE];
+ SIZEDATAFLAGSINFO info;
+} FILEINFOEX;
diff --git a/rfb/rfb.dsp b/rfb/rfb.dsp
index 6d0c20c..39bc2b9 100644
--- a/rfb/rfb.dsp
+++ b/rfb/rfb.dsp
@@ -174,6 +174,10 @@
# End Source File
# Begin Source File
+SOURCE=.\FileInfo.cxx
+# End Source File
+# Begin Source File
+
SOURCE=.\FileManager.cxx
# End Source File
# Begin Source File
@@ -420,6 +424,10 @@
# End Source File
# Begin Source File
+SOURCE=.\FileInfo.h
+# End Source File
+# Begin Source File
+
SOURCE=.\FileManager.h
# End Source File
# Begin Source File
diff --git a/vncviewer/vncviewer.dsp b/vncviewer/vncviewer.dsp
index 9cba6d6..ba630ee 100644
--- a/vncviewer/vncviewer.dsp
+++ b/vncviewer/vncviewer.dsp
@@ -150,6 +150,10 @@
# End Source File
# Begin Source File
+SOURCE=..\rfb\FileInfo.cxx
+# End Source File
+# Begin Source File
+
SOURCE=..\rfb\FileManager.cxx
# End Source File
# Begin Source File