summaryrefslogtreecommitdiff
path: root/catchcopy-windows-explorer-plugin/ClientCatchcopy.h
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2020-08-11 22:35:12 +0100
committerThomas Preud'homme <robotux@celest.fr>2020-08-11 22:35:12 +0100
commit3ac113857071fc1f225b2e1b42547269e568c6b7 (patch)
tree8b28dd9c44a0d3c7ab8187cd8d8f19d47591d813 /catchcopy-windows-explorer-plugin/ClientCatchcopy.h
parent9b10c21f5cad0e2ec27d23c59e65af7141a226f3 (diff)
New upstream version 2.2.4.4
Diffstat (limited to 'catchcopy-windows-explorer-plugin/ClientCatchcopy.h')
-rwxr-xr-xcatchcopy-windows-explorer-plugin/ClientCatchcopy.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/catchcopy-windows-explorer-plugin/ClientCatchcopy.h b/catchcopy-windows-explorer-plugin/ClientCatchcopy.h
new file mode 100755
index 0000000..954bff7
--- /dev/null
+++ b/catchcopy-windows-explorer-plugin/ClientCatchcopy.h
@@ -0,0 +1,68 @@
+/** \file ClientCatchcopy.h
+\brief Define the catchcopy client
+\author alpha_one_x86
+\version 0002
+\date 2010 */
+
+#ifndef CLIENTCATCHCOPY_H
+#define CLIENTCATCHCOPY_H
+
+#define NONBLOCK_FLAG
+#define BUFSIZE 512
+#define S_LEN 8
+
+#define C_INT(p) *((int *) (p))
+#define BLOCK_SIZ 64000
+#define BUFFER_PIPE 32000
+
+#include <windows.h>
+#include <string>
+#include <deque>
+#include <stdlib.h>
+
+#include "Variable.h"
+#include "Deque.h"
+
+typedef unsigned char byte_t;
+
+class ClientCatchcopy
+{
+ public:
+ ClientCatchcopy();
+ ~ClientCatchcopy();
+ bool connectToServer();
+ void disconnectFromServer();
+ /// \brief to send order
+ bool sendProtocol();
+ bool setClientName(wchar_t *name);
+ bool addCopyWithDestination(CDeque sources,wchar_t *destination);
+ bool addCopyWithoutDestination(CDeque sources);
+ bool addMoveWithDestination(CDeque sources,wchar_t *destination);
+ bool addMoveWithoutDestination(CDeque sources);
+ /// \brief to send stream of string list
+ bool sendRawOrderList(CDeque order,bool first_try=true);
+ bool isConnected();
+ private:
+ HANDLE m_hpipe;
+ unsigned int idNextOrder;
+ char *m_pipename;
+ byte_t *m_blk;
+ int m_tot;
+ int m_len;
+
+ char * toHex(const char *str);
+ int dataToPipe();
+ int addInt32(int value);
+ int addStr(WCHAR *data);
+ byte_t *blkGrowing(int added);
+ void setInt32(int offset, int value);
+ int toBigEndian(WCHAR *p);
+ void clear();
+ int writePipe(HANDLE hPipe, byte_t *ptr, int len);
+ #ifdef NONBLOCK_FLAG
+ int writePipe_nonBlock(HANDLE hPipe, byte_t *ptr, int len);
+ #endif
+ bool canConnect;
+};
+
+#endif // CLIENTCATCHCOPY_H