Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

CProtocolUtil Class Reference

Synergy protocol utilities. More...

#include <CProtocolUtil.h>

List of all members.

Static Public Member Functions

void writef (IStream *, const char *fmt,...)
 Write formatted data.
bool readf (IStream *, const char *fmt,...)
 Read formatted data.


Detailed Description

Synergy protocol utilities.

This class provides various functions for implementing the synergy protocol.

Definition at line 29 of file CProtocolUtil.h.


Member Function Documentation

bool CProtocolUtil::readf IStream ,
const char *  fmt,
  ...
[static]
 

Read formatted data.

Read formatted binary data from a buffer. This performs the reverse operation of writef(). Returns true if the entire format was successfully parsed, false otherwise.

Format specifiers are:

  • %% -- read (and discard) a literal `%'
  • %1i -- reads a 1 byte integer; argument is a SInt32* or UInt32*
  • %2i -- reads an NBO 2 byte integer; arg is SInt32* or UInt32*
  • %4i -- reads an NBO 4 byte integer; arg is SInt32* or UInt32*
  • %1I -- reads 1 byte integers; arg is std::vector<UInt8>*
  • %2I -- reads NBO 2 byte integers; arg is std::vector<UInt16>*
  • %4I -- reads NBO 4 byte integers; arg is std::vector<UInt32>*
  • %s -- reads bytes; argument must be a CString*, not a char*

Definition at line 43 of file CProtocolUtil.cpp.

void CProtocolUtil::writef IStream ,
const char *  fmt,
  ...
[static]
 

Write formatted data.

Write formatted binary data to a stream. fmt consists of regular characters and format specifiers. Format specifiers begin with %. All characters not part of a format specifier are regular and are transmitted unchanged.

Format specifiers are:

  • %% -- literal `%'
  • %1i -- converts integer argument to 1 byte integer
  • %2i -- converts integer argument to 2 byte integer in NBO
  • %4i -- converts integer argument to 4 byte integer in NBO
  • %1I -- converts std::vector<UInt8>* to 1 byte integers
  • %2I -- converts std::vector<UInt16>* to 2 byte integers in NBO
  • %4I -- converts std::vector<UInt32>* to 4 byte integers in NBO
  • %s -- converts CString* to stream of bytes
  • %S -- converts integer N and const UInt8* to stream of N bytes

Definition at line 27 of file CProtocolUtil.cpp.

Referenced by CClientProxy::close(), CClientProxy1_0::enter(), CClientProxy1_0::grabClipboard(), CClientProxy1_1::keyDown(), CClientProxy1_0::keyDown(), CClientProxy1_1::keyRepeat(), CClientProxy1_0::keyRepeat(), CClientProxy1_1::keyUp(), CClientProxy1_0::keyUp(), CClientProxy1_0::leave(), CClientProxy1_0::mouseDown(), CClientProxy1_0::mouseMove(), CClientProxy1_2::mouseRelativeMove(), CClientProxy1_0::mouseUp(), CClientProxy1_3::mouseWheel(), CClientProxy1_0::mouseWheel(), CClientProxy1_0::resetOptions(), CClientProxy1_0::screensaver(), CClientProxy1_0::setClipboard(), and CClientProxy1_0::setOptions().


The documentation for this class was generated from the following files:
Generated on Fri Nov 6 00:21:29 2009 for synergy-plus by  doxygen 1.3.9.1