Qt 4.8
Macros | Functions
qwsutils_qws.h File Reference
#include <QtCore/QIODevice>

Go to the source code of this file.

Macros

#define QWS_SOCK_BASE   QUnixSocket
 
#define QWS_SOCK_SERVER_BASE   QUnixSocketServer
 

Functions

int qws_read_uint (QIODevice *socket)
 
void qws_write_uint (QIODevice *socket, int i)
 

Macro Definition Documentation

◆ QWS_SOCK_BASE

#define QWS_SOCK_BASE   QUnixSocket

Definition at line 54 of file qwsutils_qws.h.

Referenced by QWSServerPrivate::_q_newConnection().

◆ QWS_SOCK_SERVER_BASE

#define QWS_SOCK_SERVER_BASE   QUnixSocketServer

Definition at line 55 of file qwsutils_qws.h.

Function Documentation

◆ qws_read_uint()

int qws_read_uint ( QIODevice socket)
inline

Definition at line 73 of file qwsutils_qws.h.

Referenced by RequestAnalyzer::analyze(), qws_read_command(), QWSDisplay::Data::readMore(), and QWSClient::readMoreCommand().

74 {
75  if (!socket || socket->bytesAvailable() < (int)sizeof(int))
76  return -1;
77 
78  int i;
79  socket->read(reinterpret_cast<char*>(&i), sizeof(i));
80 
81  return i;
82 }
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read...
Definition: qiodevice.cpp:791
virtual qint64 bytesAvailable() const
Returns the number of bytes that are available for reading.
Definition: qiodevice.cpp:752

◆ qws_write_uint()

void qws_write_uint ( QIODevice socket,
int  i 
)
inline

Definition at line 84 of file qwsutils_qws.h.

Referenced by qws_write_command().

85 {
86  if (!socket)
87  return;
88 
89  socket->write(reinterpret_cast<char*>(&i), sizeof(i));
90 }
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
Definition: qiodevice.cpp:1342