summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Craig <craig@ics.com>2012-05-16 16:57:47 -0400
committerChris Craig <craig@ics.com>2013-03-02 01:14:22 +0100
commit30732793943bd396d6a42c7c69c34814ebe4eaab (patch)
tree6028c7db38f86c3a1205938fb139bfad8b8f9b60
parentfbaf9e46a9f8114801171f9669f1b83eae5d745d (diff)
Documentation updates and fixes
- QJsonConnection and QJsonEndpoint doc updates. - Fixes to build docs correctly with Qt 5.0 release. Change-Id: I6a075a274e361417051464bfa85f1211149386ca Reviewed-by: Chris Craig <craig@ics.com>
-rw-r--r--.gitignore1
-rw-r--r--doc/doc.pri7
-rw-r--r--src/jsonstream/doc/images/classes.png (renamed from doc/images/classes.png)bin11650 -> 11650 bytes
-rw-r--r--src/jsonstream/doc/images/diagrams.graffle (renamed from doc/images/diagrams.graffle)0
-rw-r--r--src/jsonstream/doc/jsonstream.qdocconf (renamed from doc/jsonstream.qdocconf)28
-rw-r--r--src/jsonstream/doc/src/authorities.qdoc (renamed from doc/src/authorities.qdoc)0
-rw-r--r--src/jsonstream/doc/src/connection.qdoc165
-rw-r--r--src/jsonstream/doc/src/index.qdoc (renamed from doc/src/index.qdoc)1
-rw-r--r--src/jsonstream/doc/src/jsonstreamnamespace.qdoc (renamed from doc/src/jsonstreamnamespace.qdoc)18
-rw-r--r--src/jsonstream/doc/src/serialization.qdoc (renamed from doc/src/serialization.qdoc)2
-rw-r--r--src/jsonstream/doc/src/using.qdoc (renamed from doc/src/using.qdoc)0
-rw-r--r--src/jsonstream/doc/style.css (renamed from doc/style.css)0
-rw-r--r--src/jsonstream/jsonstream.pro2
-rw-r--r--src/jsonstream/qjsonauthority.cpp1
-rw-r--r--src/jsonstream/qjsonbuffer.cpp31
-rw-r--r--src/jsonstream/qjsonclient.cpp1
-rw-r--r--src/jsonstream/qjsonconnection.cpp117
-rw-r--r--src/jsonstream/qjsonconnectionprocessor.cpp54
-rw-r--r--src/jsonstream/qjsonendpoint.cpp71
-rw-r--r--src/jsonstream/qjsonendpointmanager.cpp39
-rw-r--r--src/jsonstream/qjsonpidauthority.cpp1
-rw-r--r--src/jsonstream/qjsonpipe.cpp1
-rw-r--r--src/jsonstream/qjsonserver.cpp5
-rw-r--r--src/jsonstream/qjsonserverclient.cpp3
-rw-r--r--src/jsonstream/qjsonstream.cpp46
-rw-r--r--src/jsonstream/qjsontokenauthority.cpp1
-rw-r--r--src/jsonstream/qjsonuidauthority.cpp1
-rw-r--r--src/jsonstream/qjsonuidrangeauthority.cpp1
-rw-r--r--src/jsonstream/qtjsonschema/qjsonschemaerror.cpp1
-rw-r--r--src/jsonstream/qtjsonschema/qjsonschemavalidator.cpp7
30 files changed, 501 insertions, 104 deletions
diff --git a/.gitignore b/.gitignore
index b05d7fa..61cddd9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,4 @@ Makefile.Debug
Makefile.Release
mkspecs/*
src/include/*
+doc/*
diff --git a/doc/doc.pri b/doc/doc.pri
deleted file mode 100644
index 0c80540..0000000
--- a/doc/doc.pri
+++ /dev/null
@@ -1,7 +0,0 @@
-OTHER_FILES += $$PWD/jsonstream.qdocconf
-
-docs_target.target = docs
-docs_target.commands = qdoc $$PWD/jsonstream.qdocconf
-
-QMAKE_EXTRA_TARGETS = docs_target
-QMAKE_CLEAN += "-r $$PWD/html"
diff --git a/doc/images/classes.png b/src/jsonstream/doc/images/classes.png
index c31840f..c31840f 100644
--- a/doc/images/classes.png
+++ b/src/jsonstream/doc/images/classes.png
Binary files differ
diff --git a/doc/images/diagrams.graffle b/src/jsonstream/doc/images/diagrams.graffle
index c0d1714..c0d1714 100644
--- a/doc/images/diagrams.graffle
+++ b/src/jsonstream/doc/images/diagrams.graffle
diff --git a/doc/jsonstream.qdocconf b/src/jsonstream/doc/jsonstream.qdocconf
index bd816dc..f1e869a 100644
--- a/doc/jsonstream.qdocconf
+++ b/src/jsonstream/doc/jsonstream.qdocconf
@@ -1,12 +1,12 @@
# alias.i = e
-project = JsonStream
+project = QtJsonStream
description = JSONStream Manager Documentation
-exampledirs = ../examples
-headerdirs = ./src ../src
+#exampledirs = ../examples
+headerdirs = ..
imagedirs = images
-sourcedirs = ./src ../src
+sourcedirs = ..
Cpp.ignoretokens = \
QT_BEGIN_HEADER \
@@ -24,32 +24,32 @@ Cpp.ignoretokens = \
# Defines the name of the project. You cannot use operators (+, =, -) in
# the name. Properties for this project are set using a qhp.<projectname>.property
# format.
-qhp.projects = JsonStream
+qhp.projects = QtJsonStream
# Sets the name of the output qhp file.
-qhp.JsonStream.file = JsonStream.qhp
+qhp.QtJsonStream.file = jsonstream.qhp
# Namespace for the output file. This namespace is used to distinguish between
# different documentation files in Creator/Assistant. The namespace ends with
# a version being a number containing a major, minor and revision element.
# E.g. version 1.0 becomes 100.
-qhp.JsonStream.namespace = com.nokia.jsonstream.100
+qhp.QtJsonStream.namespace = com.nokia.jsonstream.100
# Title for the package, will be the main title for the package in
# Assistant/Creator.
-qhp.JsonStream.indexTitle = JSON Stream Reference Documentation
+qhp.QtJsonStream.indexTitle = JSON Stream Reference Documentation
# Extra files to add to the output which are not linked to from anywhere
# using a qdoc \l command.
-qhp.JsonStream.extraFiles = style/style.css \
+qhp.QtJsonStream.extraFiles = style/style.css \
index.html
# Only update the name of the project for the next variables.
-qhp.JsonStream.virtualFolder = qdoc
-qhp.JsonStream.subprojects = classes
-qhp.JsonStream.subprojects.classes.title = Classes
-qhp.JsonStream.subprojects.classes.selectors = class fake:headerfile
-qhp.JsonStream.subprojects.classes.sortPages = true
+qhp.QtJsonStream.virtualFolder = qdoc
+qhp.QtJsonStream.subprojects = classes
+qhp.QtJsonStream.subprojects.classes.title = Classes
+qhp.QtJsonStream.subprojects.classes.selectors = class fake:headerfile
+qhp.QtJsonStream.subprojects.classes.sortPages = true
# Do NOT change the variables after this line unless you know what you are doing.
diff --git a/doc/src/authorities.qdoc b/src/jsonstream/doc/src/authorities.qdoc
index f749a64..f749a64 100644
--- a/doc/src/authorities.qdoc
+++ b/src/jsonstream/doc/src/authorities.qdoc
diff --git a/src/jsonstream/doc/src/connection.qdoc b/src/jsonstream/doc/src/connection.qdoc
new file mode 100644
index 0000000..427e05f
--- /dev/null
+++ b/src/jsonstream/doc/src/connection.qdoc
@@ -0,0 +1,165 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of JsonStream
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\title Multiplexing using QJsonConnection and QJsonEndpoint
+\target connection
+\page connection.html
+
+The most common use case for the JSON Stream module is a single client
+connected to a single server, as described \l{using}{here}.
+Occasionally, however, you may want to have multiple logical
+"connections" to a server multiplexed over a single socket
+connection. In this case, you can use QJsonConnection and
+QJsonEndpoint.
+
+\section1 Creating a Connection
+
+QJsonConnection represents the actual socket connection to the
+server. It has connection methods and properties similar to those of
+QJsonClient. It lacks, however, any receiving and sending methods and
+signals.
+
+\code
+ QJsonConnection *connection = new QJsonConnection();
+ connection->setFormat(FormatUTF8);
+ connection->connectLocal("/tmp/test_socket");
+\endcode
+
+\section1 The Default Endpoint
+
+To receive and send messages, you use a QJsonEndpoint. A default
+endpoint is provided via QJsonConnection::defaultEndpoint(). This
+endpoint is always associated with the endpoint, so you can send
+messages like this:
+
+\code
+ connection->defaultEndpoint()->send(myJsonObject);
+\endcode
+
+QJsonEndpoint uses a readyRead API to minimize buffering. This means
+that the endpoint will signal when there is a message available for
+the endpoint. It is then up to the user to read the message and
+continue to read messages until there are no more available for that
+endpoint.
+
+\code
+ connect(connection->defaultEndpoint(), SIGNAL(readyReadMessage()), SLOT(readMessages()));
+ <...>
+
+ void MyClass::readMessages()
+ {
+ while (connection->defaultEndpoint()->messageAvailable()) {
+ QJsonObject msg = connection->defaultEndpoint()->readMessage();
+ <process message here>
+ }
+ }
+\endcode
+
+\section1 Adding Additional Endpoints
+
+Additional endpoints can be created and associated with the
+connection. Each additional endpoint must have a unique
+\l{QJsonEndpoint::name()}{name()}. This name is used by the
+connection to determine which endpoint should process each message.
+
+\code
+ QJsonEndpoint *endpoint = new QJsonEndpoint();
+ endpoint->setName("endpointName1");
+ endpoint->setConnection(connection);
+
+ connect(endpoint, SIGNAL(readyReadMessage()), SLOT(readMessages()));
+\endcode
+
+As with the default endpoint, you must connect to
+\l{QJsonEndpoint::readyReadMessage()}{readyReadMessage()} and process
+messages when signaled.
+
+\section1 Directing Incoming Messages to Endpoints
+
+QJsonConnection uses a property on each incoming message to determine
+which endpoint should receive the message. The
+\l{QJsonConnection::endpointPropertyName()}{endpointPropertyName()}
+property specifies the name of the property in the incoming message
+that should be retrieved. The value of this property is assumed to be
+the name of an endpoint. QJsonConnection attempts to match this value
+with one of its associated endpoints. If it finds a match, the
+message is directed to that endpoint. If no match is found, it is
+directed to the default endpoint.
+
+If a connection and endpoint is set up like this:
+
+\code
+ QJsonConnection *connection = new QJsonConnection();
+ connection->setEndpointPropertyName("endpoint");
+
+ QJsonEndpoint *endpoint = new QJsonEndpoint("endpoint1", connection);
+\endcode
+
+and the following incoming message is received:
+
+\code
+{
+ "messageType": "update",
+ "endpoint": "endpoint1",
+ "newValue": "value1"
+}
+\endcode
+
+then it will be directed to endpoint1.
+
+However, if this message is received:
+
+\code
+{
+ "messageType": "update",
+ "endpoint": "endpointX",
+ "newValue": "value2"
+}
+\endcode
+
+then it will be directed to the default endpoint.
+
+\section1 Multithreading
+
+QJsonConnection and QJsonEndpoint can be used in a single threaded
+environment, but one of the main features of this system is that
+endpoints may be used in different threads. The endpoint methods
+\l{QJsonEndpoint::send()}{send()},
+\l{QJsonEndpoint::messageAvailable()}{messageAvailable()},
+\l{QJsonEndpoint::readMessage()}{readMessage()},
+and \l{QJsonEndpoint::readMessageMap()}{readMessageMap()} are
+thread-safe, so endpoint processing can take place in a thread
+different from that of the connection.
+
+Internal connection processing will take place in the affined thread
+of the connection object, unless the object's
+\l{QJsonConnection::useSeparateThreadForProcessing()}{useSeparateThreadForProcessing()}
+property is set to true. In that case, a new, internal thread is
+created for sole use of connection processing. This can be useful if
+you do not want to use the main thread for the connection.
+*/
diff --git a/doc/src/index.qdoc b/src/jsonstream/doc/src/index.qdoc
index 879c943..7a2fe11 100644
--- a/doc/src/index.qdoc
+++ b/src/jsonstream/doc/src/index.qdoc
@@ -42,6 +42,7 @@ The JSON Stream classes implement a client/server framework.
\list
\li \l{Stream serialization}
\li \l{Using JSON stream classes}
+ \li \l{Multiplexing Using QJsonConnection and QJsonEndpoint}
\li \l{Authority notes}
\endlist
diff --git a/doc/src/jsonstreamnamespace.qdoc b/src/jsonstream/doc/src/jsonstreamnamespace.qdoc
index 630e24f..4051115 100644
--- a/doc/src/jsonstreamnamespace.qdoc
+++ b/src/jsonstream/doc/src/jsonstreamnamespace.qdoc
@@ -40,25 +40,25 @@
****************************************************************************/
\*!
- \namespace JsonStream
- \brief The JsonStream namespace contains miscellaneous identifiers
+ \namespace QtJsonStream
+ \brief The QtJsonStream namespace contains miscellaneous identifiers
used throughout the JsonStream library.
*/
/*!
- \headerfile <jsonstream-global.h>
- \title Global JsonStream declarations
+ \headerfile <qjsonstream-global.h>
+ \title Global QtJsonStream declarations
- \brief The <jsonstream-global.h> file provides namespace
- declarations and global enumerations for JsonStream.
+ \brief The <qjsonstream-global.h> file provides namespace
+ declarations and global enumerations for QtJsonStream.
*/
/*!
- \relates <jsonstream-global.h>
+ \relates <qjsonstream-global.h>
\enum EncodingFormat
This enum is used to control the serialization format of the data stream.
- All data streams start as \c JsonStream::FormatUndefined. Once a data message is received,
+ All data streams start as \c QJsonStream::FormatUndefined. Once a data message is received,
the stream automatically switches to the format of the received message.
\value FormatUndefined No messages have been sent or received yet.
@@ -67,4 +67,6 @@
\value FormatQBJS Qt Binary Json
\value FormatUTF16BE UTF-16, Big Endian
\value FormatUTF16LE UTF-16, Little Endian
+ \value FormatUTF32BE UTF-32, Big Endian
+ \value FormatUTF32LE UTF-32, Little Endian
*/
diff --git a/doc/src/serialization.qdoc b/src/jsonstream/doc/src/serialization.qdoc
index 7d1365f..4829a73 100644
--- a/doc/src/serialization.qdoc
+++ b/src/jsonstream/doc/src/serialization.qdoc
@@ -104,7 +104,7 @@ Clearly, there is a danger that the BSON encoding format could be
confused with UTF-32LE, UTF-16BE, UTF-16LE, or even UTF-8 (for
example, "7B 20 7D 00" which is '{ }'). To avoid confusion, it is
recommended that UTF-16 encodings send a BOM (U+FEFF) character to
-start their stream. When in doubt, the protcol will select UTF
+start their stream. When in doubt, the protocol will select UTF
encoding formats before BSON, which means that UTF-32LE is
particularly susceptable to being done incorrectly.
diff --git a/doc/src/using.qdoc b/src/jsonstream/doc/src/using.qdoc
index 3844bb2..3844bb2 100644
--- a/doc/src/using.qdoc
+++ b/src/jsonstream/doc/src/using.qdoc
diff --git a/doc/style.css b/src/jsonstream/doc/style.css
index 24b0e0e..24b0e0e 100644
--- a/doc/style.css
+++ b/src/jsonstream/doc/style.css
diff --git a/src/jsonstream/jsonstream.pro b/src/jsonstream/jsonstream.pro
index 7d4c863..f72c38f 100644
--- a/src/jsonstream/jsonstream.pro
+++ b/src/jsonstream/jsonstream.pro
@@ -2,6 +2,8 @@ TARGET = QtAddOnJsonStream
QT += core network
QT -= gui
+QMAKE_DOCS = $$PWD/doc/jsonstream.qdocconf
+
load(qt_module)
DEFINES += QT_ADDON_JSONSTREAM_LIB
diff --git a/src/jsonstream/qjsonauthority.cpp b/src/jsonstream/qjsonauthority.cpp
index 2bda29d..0e0f203 100644
--- a/src/jsonstream/qjsonauthority.cpp
+++ b/src/jsonstream/qjsonauthority.cpp
@@ -46,6 +46,7 @@ QT_BEGIN_NAMESPACE_JSONSTREAM
/**************************************************************************************************/
/*!
\class QJsonAuthority
+ \inmodule QtJsonStream
\brief The QJsonAuthority class is an abstract class used to authorize new QJson client connections.
The QJsonAuthority class authorizes QJson client connections.
diff --git a/src/jsonstream/qjsonbuffer.cpp b/src/jsonstream/qjsonbuffer.cpp
index b73071d..13a7bd5 100644
--- a/src/jsonstream/qjsonbuffer.cpp
+++ b/src/jsonstream/qjsonbuffer.cpp
@@ -62,6 +62,7 @@ inline bool isjsonws(T c)
/*!
\class QJsonBuffer
+ \inmodule QtJsonStream
\brief The QJsonBuffer class parses data received into appropriate QJson messages
The QJsonBuffer class wraps an internal buffer. As you append
@@ -119,9 +120,9 @@ QJsonBuffer::QJsonBuffer(QObject *parent)
*/
/*!
- Append the contents of a byte array \a data onto the buffer.
- During the execution of this function, the \l{readyReadMessage()}
- signal may be raised.
+ Append the contents of a byte array \a data into the buffer. If a message
+ is not already available, the buffer will be parsed, and the \l{readyReadMessage()}
+ signal may be emitted.
*/
void QJsonBuffer::append(const QByteArray& data)
@@ -135,9 +136,9 @@ void QJsonBuffer::append(const QByteArray& data)
}
/*!
- Append the \a data pointer with length \a len onto the QJsonBuffer.
- During the execution of this function, the \l{readyReadMessage()}
- signal may be raised.
+ Append the \a data pointer with length \a len onto the QJsonBuffer. If a message
+ is not already available, the buffer will be parsed, and the \l{readyReadMessage()}
+ signal may be emitted.
*/
void QJsonBuffer::append(const char *data, int len)
@@ -156,6 +157,9 @@ void QJsonBuffer::append(const char *data, int len)
It assumes that the file descriptor is ready to read and
it does not try to read all of the data.
+ If a message is not already available, the buffer will be parsed, and the
+ \l{readyReadMessage()} signal may be emitted.
+
Returns the number of bytes read or -1 for an error condition.
*/
@@ -225,6 +229,9 @@ bool QJsonBuffer::scanUtf( int c )
return false;
}
+/*!
+ \internal
+*/
void QJsonBuffer::resetParser()
{
mParserState = ParseNormal;
@@ -487,6 +494,11 @@ EncodingFormat QJsonBuffer::format() const
return mFormat;
}
+/*!
+ \internal
+ If thread protection is enabled, this method returns a newly allocated
+ mutex locker that locks the mutex, otherwise it returns 0.
+ */
QMutexLocker *QJsonBuffer::createLocker()
{
return mThreadProtection ? new QMutexLocker(&mMutex) : 0;
@@ -519,6 +531,13 @@ QMutexLocker *QJsonBuffer::createLocker()
be reemitted.
*/
+/*!
+ \fn QJsonBuffer:: setThreadProtection(bool enable)
+
+ Controls whether the buffer is thread-safe. If \a enable is \b true,
+ all access to the buffer will be protected by a mutex.
+*/
+
#include "moc_qjsonbuffer_p.cpp"
QT_END_NAMESPACE_JSONSTREAM
diff --git a/src/jsonstream/qjsonclient.cpp b/src/jsonstream/qjsonclient.cpp
index 3ed44ce..f2b6e4d 100644
--- a/src/jsonstream/qjsonclient.cpp
+++ b/src/jsonstream/qjsonclient.cpp
@@ -70,6 +70,7 @@ public:
/*!
\class QJsonClient
+ \inmodule QtJsonStream
\brief The QJsonClient class is used to send jsons to the QJsonServer.
Note: The QJsonClient is not thread safe.
diff --git a/src/jsonstream/qjsonconnection.cpp b/src/jsonstream/qjsonconnection.cpp
index 1a63559..1e4ee1d 100644
--- a/src/jsonstream/qjsonconnection.cpp
+++ b/src/jsonstream/qjsonconnection.cpp
@@ -101,25 +101,46 @@ public:
/*!
\class QJsonConnection
- \brief The QJsonConnection class ...
-
+ \inmodule QtJsonStream
+ \brief The QJsonConnection class is a thread-safe client connection object that can be
+ used by multiple endpoint objects.
+
+ QJsonConnection implements a thread-safe client connection object.
+ Multiple QJsonEndpoint objects (possibly from different threads) can use a
+ QJsonConnection, providing a type of multiplexing on a single connection. The
+ endpointPropertyName() property specifies the property that controls which endpoint
+ an inbound message should be delivered to. A default endpoint is provided via
+ defaultEndpoint().
+
+ The processing of the connection can take place in the connection object's
+ affined thread or a separate thread, depending on the value of
+ useSeparateThreadForProcessing().
*/
/*!
\enum QJsonConnection::State
- This enum describes the different states in which a connection can be.
+ This enumuration describes the different states in which a connection can be.
- \value Unconnected No connected.
+ \value Unconnected Not connected.
\value Connecting Started establishing a connection.
\value Authenticating Started authentication process.
- \value Connected A connection is established.
+ \value Connected Connection is established.
+*/
+
+/*!
+ \enum QJsonConnection::Error
- \sa QJsonConnection::state()
+ This enumuration describes error conditions for QJsonConnection.
+
+ \value NoError No error.
+ \value UnknownError Unknown error.
+ \value LocalSocketError subError() is a local socket error code.
+ \value TcpSocketError subError() is a TCP socket error code.
*/
/*!
- Constructs a \c QJsonConnection object.
+ Constructs a \c QJsonConnection object with \a parent.
*/
QJsonConnection::QJsonConnection(QObject *parent)
@@ -199,7 +220,7 @@ QString QJsonConnection::errorString() const
}
/*!
- Returns a socket name to be used for Unix local socket connection.
+ Returns the socket name to be used for Unix local socket connection.
*/
QString QJsonConnection::localSocketName() const
{
@@ -217,7 +238,7 @@ void QJsonConnection::setLocalSocketName(const QString &name)
}
/*!
- Returns a host name to be used for TCP socket connection.
+ Returns the host name to be used for TCP socket connection.
*/
QString QJsonConnection::tcpHostName() const
{
@@ -235,7 +256,7 @@ void QJsonConnection::setTcpHostName(const QString &name)
}
/*!
- Returns a port number to be used for TCP socket connection.
+ Returns the port number to be used for TCP socket connection.
*/
int QJsonConnection::tcpHostPort() const
{
@@ -273,7 +294,7 @@ void QJsonConnection::setAutoReconnectEnabled(bool enabled)
}
/*!
- Returns a property which value in message object will be used as an endpoint name.
+ Returns the property which value in message object will be used as an endpoint name.
*/
QString QJsonConnection::endpointPropertyName() const
{
@@ -293,7 +314,7 @@ void QJsonConnection::setEndpointPropertyName(const QString &property)
}
/*!
- Returns a maximum size of the inbound message buffer.
+ Returns the maximum size of the inbound message buffer.
*/
qint64 QJsonConnection::readBufferSize() const
{
@@ -323,7 +344,7 @@ void QJsonConnection::setReadBufferSize(qint64 sz)
}
/*!
- Returns a maximum size of the outbound message buffer. A value of 0
+ Returns the maximum size of the outbound message buffer. A value of 0
means the buffer size is unlimited.
*/
qint64 QJsonConnection::writeBufferSize() const
@@ -354,7 +375,8 @@ void QJsonConnection::setWriteBufferSize(qint64 sz)
}
/*!
- Adds endpoint to a connection.
+ Adds \a endpoint to the connection. Messages routed for the endpoint's
+ \l{QJsonEndpoint::name()}{name()} will be delivered to the endpoint.
*/
void QJsonConnection::addEndpoint(QJsonEndpoint *endpoint)
{
@@ -365,7 +387,8 @@ void QJsonConnection::addEndpoint(QJsonEndpoint *endpoint)
}
/*!
- Removes endpoint from a connection.
+ Removes \a endpoint from the connection. No further messages will be delivered
+ to the endpoint.
*/
void QJsonConnection::removeEndpoint(QJsonEndpoint *endpoint)
{
@@ -374,7 +397,7 @@ void QJsonConnection::removeEndpoint(QJsonEndpoint *endpoint)
}
/*!
- Sets whether to create a separate worker thread for a connection
+ Sets whether a separate connection processing thread should be used.
*/
void QJsonConnection::setUseSeparateThreadForProcessing(bool use)
{
@@ -386,9 +409,8 @@ void QJsonConnection::setUseSeparateThreadForProcessing(bool use)
}
/*!
- Returns whether a separate worker thread for a connection required
+ Returns whether a separate connection processing thread should be used.
*/
-
bool QJsonConnection::useSeparateThreadForProcessing() const
{
Q_D(const QJsonConnection);
@@ -396,7 +418,9 @@ bool QJsonConnection::useSeparateThreadForProcessing() const
}
/*!
- Returns a default endpoint without name.
+ Returns the default endpoint. This endpoint will be used to process any
+ messages that cannot be directed to a named endpoint. You must not change
+ the name of the default endpoint.
*/
QJsonEndpoint * QJsonConnection::defaultEndpoint()
@@ -512,6 +536,53 @@ void QJsonConnection::handleError(QJsonConnection::Error err, int suberr, QStrin
emit error(d->mError, d->mSubError);
}
+/*! \property QJsonConnection::localSocketName
+ File path of a local socket to be used for local socket connections.
+*/
+
+/*! \property QJsonConnection::tcpHostName
+ Host name to be used for TCP socket connections.
+*/
+
+/*! \property QJsonConnection::tcpHostPort
+ Port number to be used for TCP socket connections.
+*/
+
+/*! \property QJsonConnection::state
+ The state of the connection.
+ */
+
+/*! \property QJsonConnection::autoReconnectEnabled
+ Specifies if automatic reconnection to the server should be attempted if the connection is lost.
+*/
+
+/*! \property QJsonConnection::endpointPropertyName
+ Specifies a property in inbound JSON messages whose value will be used to determine
+ which endpoint the message should be delivered to.
+*/
+
+/*! \property QJsonConnection::readBufferSize
+ The maximum size of the read buffer. Messages that are larger than the read buffer
+ size will be rejected and the connection will be closed. A value of 0 means
+ the read buffer is unlimited.
+ */
+
+/*! \property QJsonConnection::writeBufferSize
+ The maximum size of the outbound message buffer. Messages that are larger than the
+ write buffer size will not be sent. A value of 0 means the buffer size is unlimited.
+ */
+
+/*! \property QJsonConnection::useSeparateThreadForProcessing
+ Specifies whether the connection should be processed in a separate thread (created and
+ controlled by QJsonConnection) or in the object's affined thread.
+*/
+
+/*! \property QJsonConnection::defaultEndpoint
+ Specifies the default endpoint. This endpoint will be used to process any
+ messages that cannot be directed to a named endpoint. You must not change
+ the name of the default endpoint.
+*/
+
/*! \fn QJsonConnection::bytesWritten(qint64 bytes)
This signal is emitted every time a payload of data has been
@@ -522,10 +593,10 @@ void QJsonConnection::handleError(QJsonConnection::Error err, int suberr, QStrin
/*! \fn QJsonConnection::readBufferOverflow(qint64 bytes)
This signal is emitted when the read buffer is full of data that has been read
- from the \l{device()}, \a bytes additional bytes are available on the device,
+ from the stream, \a bytes additional bytes are available on the stream,
but the message is not complete. The \l{readBufferSize()} may be increased
to a sufficient size in a slot connected to this signal, in which case more
- data will be read into the read buffer. If the buffer size is not increased,
+ data will be read into the read buffer. If the read buffer size is not increased,
the connection is closed.
*/
@@ -534,8 +605,6 @@ void QJsonConnection::handleError(QJsonConnection::Error err, int suberr, QStrin
This signal is emitted whenever QJsonConnection's state changes.
The \a state parameter is the new state.
-
- \sa state()
*/
/*!
@@ -545,7 +614,7 @@ void QJsonConnection::handleError(QJsonConnection::Error err, int suberr, QStrin
parameter describes the type of error that occurred and \a subError
contains the additional error code.
- \sa error(), subError(), errorString()
+ \sa subError(), errorString()
*/
/*!
diff --git a/src/jsonstream/qjsonconnectionprocessor.cpp b/src/jsonstream/qjsonconnectionprocessor.cpp
index 79adf03..0af70cb 100644
--- a/src/jsonstream/qjsonconnectionprocessor.cpp
+++ b/src/jsonstream/qjsonconnectionprocessor.cpp
@@ -47,7 +47,6 @@
#include "qjsonbuffer_p.h"
#include <QMap>
-#include <QThread>
#include <QFile>
#include <QDir>
#include <QTimer>
@@ -89,8 +88,12 @@ public:
/*!
\class QJsonConnectionProcessor
- \brief The QJsonConnectionProcessor class ...
+ \brief The QJsonConnectionProcessor class is a helper class for QJsonConnection
+ \internal
+ QJsonConnectionProcessor handles the actual connection processing. It is
+ a separate class from QJsonConnection primarily so it can be correctly affined
+ to a separate processing thread if desired.
*/
/*!
@@ -139,6 +142,9 @@ void QJsonConnectionProcessor::setAutoReconnectEnabled(bool enabled)
d->mAutoReconnectEnabled = enabled;
}
+/*!
+ Sets the endpoint manager to \a manager.
+ */
void QJsonConnectionProcessor::setEndpointManager(QJsonEndpointManager *manager)
{
Q_D(QJsonConnectionProcessor);
@@ -430,6 +436,50 @@ bool QJsonConnectionProcessor::send(QJsonObject message)
return d->mStream.send(message);
}
+/*!
+ \fn void QJsonConnectionProcessor::bytesWritten(qint64 bytes)
+
+ This signal is emitted every time a payload of data has been written to the device.
+ The \a bytes argument is set to the number of bytes that were written in this payload.
+ */
+
+/*!
+ \fn void QJsonConnectionProcessor::disconnected()
+
+ This signal is emitted when the connection has been disconnected.
+
+ \warning If you need to delete the sender() of this signal in a slot connected
+ to it, use the \l{QObject::deleteLater()}{deleteLater()} function.
+*/
+
+/*!
+ \fn void QJsonConnectionProcessor::error(QJsonConnection::Error error, int subError, QString text)
+
+ This signal is emitted after an error occurred. The \a error
+ parameter describes the type of error that occurred, \a subError
+ contains the additional error code, and \a text contains the error text.
+*/
+
+/*! \fn QJsonConnectionProcessor::readBufferOverflow(qint64 bytes)
+
+ This signal is emitted when the read buffer is full of data that has been read
+ from the stream, \a bytes additional bytes are available on the stream,
+ but the message is not complete.
+*/
+
+/*!
+ \fn void QJsonConnectionProcessor::readyReadMessage()
+
+ This signal is emitted once every time new data arrives and a message is ready.
+*/
+
+/*!
+ \fn void QJsonConnectionProcessor::stateChanged(QJsonConnection::State state)
+
+ This signal is emitted whenever QJsonConnection's state changes.
+ The \a state parameter is the new state.
+*/
+
#include "moc_qjsonconnectionprocessor_p.cpp"
QT_END_NAMESPACE_JSONSTREAM
diff --git a/src/jsonstream/qjsonendpoint.cpp b/src/jsonstream/qjsonendpoint.cpp
index 6109959..6271989 100644
--- a/src/jsonstream/qjsonendpoint.cpp
+++ b/src/jsonstream/qjsonendpoint.cpp
@@ -68,12 +68,44 @@ public:
/*!
\class QJsonEndpoint
- \brief The QJsonEndpoint class ...
+ \inmodule QtJsonStream
+ \brief The QJsonEndpoint class is an send/receive interface to a QJsonConnection.
+ Multiple QJsonEndpoint objects may multiplex over a single QJsonConnection. This
+ can allow, for example, different libraries to create their own endpoints and
+ share a common connection to a server. QJsonConnection uses an endpoint's name()
+ to direct received JSON objects to the appropriate endpoint.
+
+ QJsonEndpoint uses a readyRead scheme to avoid possible excessive buffering of
+ JSON objects. A typical use is:
+
+ \code
+
+ QJsonEndpoint *endpoint = new QJsonEndpoint(QStringLiteral("myEndpoint"));
+ connection->addEndpoint(endpoint);
+
+ connect(endpoint, SIGNAL(readyReadMessage()), SLOT(processMessages()));
+
+ <...>
+
+ void MyClass::processMessages()
+ {
+ while (endpoint->messageAvailable()) {
+ QJsonObject msg = endpoint->readMessage();
+ <process message here>
+ }
+ }
+ \endcode
+
+ QJsonEndpoint and QJsonConnection are thread-safe, so endpoints may be used
+ in different threads. Note that QJsonConnection only processes and buffers a
+ single message. This means that if an endpoint does not respond to the
+ readyReadMessage() signal and read the message, no other messages will be read,
+ effectively blocking the stream.
*/
/*!
- Constructs a \c QJsonEndpoint object.
+ Constructs a \c QJsonEndpoint object with name \a name, using \a connection.
*/
QJsonEndpoint::QJsonEndpoint(const QString & name, QJsonConnection *connection)
@@ -87,7 +119,7 @@ QJsonEndpoint::QJsonEndpoint(const QString & name, QJsonConnection *connection)
}
/*!
- Deletes the \c QJsonEndpoint object.
+ Deletes the \c QJsonEndpoint object. Removes the endpoint from the connection().
*/
QJsonEndpoint::~QJsonEndpoint()
@@ -98,8 +130,8 @@ QJsonEndpoint::~QJsonEndpoint()
}
/*!
- Returns a name used for message multiplexing. A default endpoint should not
- have a name
+ Returns the endpoint's name. This value is used by QJsonConnection to determine which
+ messages should be directed to this endpoint.
*/
QString QJsonEndpoint::name() const
{
@@ -108,8 +140,8 @@ QString QJsonEndpoint::name() const
}
/*!
- Sets a \a name used for message multiplexing. A default endpoint should not
- have a name
+ Sets the endpoint's name. This value is used by QJsonConnection to determine which
+ messages should be directed to this endpoint.
*/
void QJsonEndpoint::setName( const QString & name )
{
@@ -119,7 +151,7 @@ void QJsonEndpoint::setName( const QString & name )
}
/*!
- Returns a connection that is used by endpoint
+ Returns the connection that is used by this endpoint.
*/
QJsonConnection *QJsonEndpoint::connection() const
{
@@ -128,7 +160,7 @@ QJsonConnection *QJsonEndpoint::connection() const
}
/*!
- Sets a \a connection to be used by endpoint
+ Sets the \a connection to be used by this endpoint.
*/
void QJsonEndpoint::setConnection(QJsonConnection *connection)
{
@@ -141,8 +173,9 @@ void QJsonEndpoint::setConnection(QJsonConnection *connection)
}
/*!
- Send a QVariantMap \a message over the connection.
+ Send \a message over the connection.
Returns \b true if the entire message was sent or buffered or \b false otherwise.
+ This method is thread-safe.
*/
bool QJsonEndpoint::send(const QVariantMap& message)
{
@@ -150,8 +183,9 @@ bool QJsonEndpoint::send(const QVariantMap& message)
}
/*!
- Send a QJsonObject \a message over the connection.
+ Send \a message over the connection.
Returns \b true if the entire message was sent or buffered or \b false otherwise.
+ This method is thread-safe.
*/
bool QJsonEndpoint::send(const QJsonObject& message)
{
@@ -190,7 +224,7 @@ void QJsonEndpoint::slotReadyReadMessage()
/*!
Returns \b true if a message is available to be read via \l{readMessage()}
- or \b false otherwise.
+ or \b false otherwise. This method is thread-safe.
*/
bool QJsonEndpoint::messageAvailable()
{
@@ -208,7 +242,7 @@ bool QJsonEndpoint::messageAvailable()
/*!
Returns a JSON object that has been received as a variant map. If no message is
- available, an empty JSON object is returned.
+ available, an empty variant map is returned. This method is thread-safe.
*/
QVariantMap QJsonEndpoint::readMessageMap()
{
@@ -217,7 +251,7 @@ QVariantMap QJsonEndpoint::readMessageMap()
/*!
Returns a JSON object that has been received. If no message is
- available, an empty JSON object is returned.
+ available, an empty JSON object is returned. This method is thread-safe.
*/
QJsonObject QJsonEndpoint::readMessage()
{
@@ -230,6 +264,15 @@ QJsonObject QJsonEndpoint::readMessage()
return obj;
}
+/*! \property QJsonEndpoint::connection
+ The connection that is used by this endpoint.
+*/
+
+/*! \property QJsonEndpoint::name
+ The endpoint's name. This value is used by QJsonConnection to determine which
+ messages should be directed to this endpoint.
+*/
+
/*!
\fn void QJsonEndpoint::readyReadMessage()
diff --git a/src/jsonstream/qjsonendpointmanager.cpp b/src/jsonstream/qjsonendpointmanager.cpp
index 8cb7730..80a1b8d 100644
--- a/src/jsonstream/qjsonendpointmanager.cpp
+++ b/src/jsonstream/qjsonendpointmanager.cpp
@@ -51,12 +51,14 @@ static const QLatin1String kstrEndpointKey("endpoint");
/*!
\class QJsonEndpointManager
- \brief The QJsonEndpointManager class ...
+ \brief The QJsonEndpointManager class maintains a list of endpoints
+ \internal
+ and determines which endpoint should be used to process a given JSON message.
*/
/*!
- Constructs a \c QJsonEndpointManager object.
+ Constructs a \c QJsonEndpointManager object with \a parent.
*/
QJsonEndpointManager::QJsonEndpointManager(QJsonConnection *parent)
@@ -73,6 +75,12 @@ QJsonEndpointManager::~QJsonEndpointManager()
clear();
}
+/*!
+ Returns the default endpoint. This endpoint is used when no matching named
+ endpoint could be found.
+
+ \sa endpoint()
+*/
QJsonEndpoint *QJsonEndpointManager::defaultEndpoint()
{
QJsonEndpoint *endpoint;
@@ -93,6 +101,9 @@ QJsonEndpoint *QJsonEndpointManager::defaultEndpoint()
return endpoint;
}
+/*!
+ Add \a endpoint to the list
+*/
void QJsonEndpointManager::addEndpoint(QJsonEndpoint *endpoint)
{
if (mEndpoints.key(endpoint).isEmpty()) {
@@ -102,12 +113,18 @@ void QJsonEndpointManager::addEndpoint(QJsonEndpoint *endpoint)
}
}
+/*!
+ Remove \a endpoint from the list
+*/
void QJsonEndpointManager::removeEndpoint(QJsonEndpoint *endpoint)
{
mEndpoints.remove(endpoint->name());
endpoint->setConnection(0);
}
+/*!
+ Return (a copy of) the list of endpoints.
+*/
QHash<QString, QJsonEndpoint*> & QJsonEndpointManager::endpoints()
{
if (!mInit) {
@@ -122,11 +139,22 @@ QHash<QString, QJsonEndpoint*> & QJsonEndpointManager::endpoints()
return mEndpoints;
}
+/*!
+ Determines the endpoint that should be used to process \a message and returns it.
+
+ The endpoint is determined by retrieving the value of the property named in
+ endpointPropertyName() from \a message. If that value matches one of the
+ endpoints' \l{QJsonEndpoint::name()}{name()} properties, that endpoint is returned.
+ If no matching endpoint could be found, the defaultEndpoint() is returned.
+*/
QJsonEndpoint *QJsonEndpointManager::endpoint(const QJsonObject &message)
{
return endpoints().value(message.value(mEndpointPropertyName).toString(), defaultEndpoint());
}
+/*!
+ Clears the endpoint list.
+ */
void QJsonEndpointManager::clear()
{
QList<QJsonEndpoint *> lst = mEndpoints.values();
@@ -141,6 +169,13 @@ void QJsonEndpointManager::handleNameChange()
mInit = false; // next call to endpoints() will rehash everything
}
+/*! \property QJsonEndpointManager::endpointPropertyName
+ Property name that will be used to retrieve a value from a message to determine
+ what endpoint should be used to process that message.
+
+ \sa endpoint()
+*/
+
#include "moc_qjsonendpointmanager_p.cpp"
QT_END_NAMESPACE_JSONSTREAM
diff --git a/src/jsonstream/qjsonpidauthority.cpp b/src/jsonstream/qjsonpidauthority.cpp
index 5ff277b..411f4a9 100644
--- a/src/jsonstream/qjsonpidauthority.cpp
+++ b/src/jsonstream/qjsonpidauthority.cpp
@@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE_JSONSTREAM
/*!
\class QJsonPIDAuthority
+ \inmodule QtJsonStream
\brief The QJsonPIDAuthority class implements a PID-based authentication scheme for QJsonServer.
The QJsonPIDAuthority class authorizes QJson client connections based on the process ID of the
diff --git a/src/jsonstream/qjsonpipe.cpp b/src/jsonstream/qjsonpipe.cpp
index 241f6b1..9df71b9 100644
--- a/src/jsonstream/qjsonpipe.cpp
+++ b/src/jsonstream/qjsonpipe.cpp
@@ -79,6 +79,7 @@ public:
/*!
\class QJsonPipe
+ \inmodule QtJsonStream
\brief The QJsonPipe class serializes JSON data.
The QJsonPipe class is a generic interface for serializing and deserializing
diff --git a/src/jsonstream/qjsonserver.cpp b/src/jsonstream/qjsonserver.cpp
index 78bf820..12149e8 100644
--- a/src/jsonstream/qjsonserver.cpp
+++ b/src/jsonstream/qjsonserver.cpp
@@ -98,6 +98,7 @@ public:
/*!
\class QJsonServer
+ \inmodule QtJsonStream
\brief The QJsonServer class is the server endpoint for JSON communications.
JSON communications is a interprocess communication (IPC) method between clients and a server.
@@ -603,13 +604,13 @@ void QJsonServer::initSchemaValidation()
*/
/*!
- \fn void QJsonServer::inboundMessageValidationFailed(const QJsonObject &message, const QtAddOn::JsonStream::SchemaError &error)
+ \fn void QJsonServer::inboundMessageValidationFailed(const QJsonObject &message, const QtAddOn::QtJsonStream::QJsonSchemaError &error)
This signal is emitted when an inbound \a message message fails a JSON schema validation. The validation
error is reported in \a error.
*/
/*!
- \fn void QJsonServer::outboundMessageValidationFailed(const QJsonObject &message, const QtAddOn::JsonStream::SchemaError &error)
+ \fn void QJsonServer::outboundMessageValidationFailed(const QJsonObject &message, const QtAddOn::QtJsonStream::QJsonSchemaError &error)
This signal is emitted when an outbound \a message message fails a JSON schema validation. The validation
error is reported in \a error.
*/
diff --git a/src/jsonstream/qjsonserverclient.cpp b/src/jsonstream/qjsonserverclient.cpp
index 489f45c..0e660e0 100644
--- a/src/jsonstream/qjsonserverclient.cpp
+++ b/src/jsonstream/qjsonserverclient.cpp
@@ -65,6 +65,7 @@ public:
/*!
\class QJsonServerClient
+ \inmodule QtJsonStream
\brief The QJsonServerClient class wraps an individual connection to the QJsonServer.
*/
@@ -137,7 +138,7 @@ QString QJsonServerClient::identifier() const
/*!
Start processing messages from this client. This function should
- only be called by the \l{JsonServer}
+ only be called by the \l{QJsonServer}
*/
void QJsonServerClient::start()
diff --git a/src/jsonstream/qjsonstream.cpp b/src/jsonstream/qjsonstream.cpp
index 41236ea..172246b 100644
--- a/src/jsonstream/qjsonstream.cpp
+++ b/src/jsonstream/qjsonstream.cpp
@@ -91,11 +91,18 @@ public:
/*!
\class QJsonStream
+ \inmodule QtJsonStream
\brief The QJsonStream class serializes JSON data.
The QJsonStream class is a generic interface for serializing and deserializing
- JSON data over a socket connection. It is designed to support multiple serialization
- and deserialization formats by auto-detecting the format in use.
+ JSON data over from an IO device (typically a socket connection). It is designed
+ to support multiple serialization and deserialization formats by auto-detecting
+ the format in use.
+
+ A key feature of QJsonStream is that the user can control buffering of data.
+ Both read and write buffer sizes can be set, and data is read from the stream
+ using a readyRead scheme, ensuring that too many inbould messages (or too large
+ inbound messages) do not overwhelm the receiving application.
*/
/*!
@@ -113,8 +120,7 @@ QJsonStream::QJsonStream(QIODevice *device)
}
/*!
- Delete the \c QJsonStream object and close the connection.
- You should call \l {setDevice()} {setDevice(0)} before calling this function.
+ QJsonStream destructor. This method does not close the device().
*/
QJsonStream::~QJsonStream()
@@ -122,7 +128,7 @@ QJsonStream::~QJsonStream()
}
/*!
- \enum QJsonStream::JsonStreamError
+ \enum QJsonStream::QJsonStreamError
\value NoError
No error has occurred.
\value WriteFailedNoConnection
@@ -130,8 +136,7 @@ QJsonStream::~QJsonStream()
\value MaxReadBufferSizeExceeded
Maximum read buffer size exceeded. Can't continue and connection will be closed.
\value MaxWriteBufferSizeExceeded
- Maximum write buffer size exceeded. Operation can be retried after write buffer maximum size increase or after data in
- the buffer will be processed by QIODevice.
+ Maximum write buffer size exceeded. Operation can be retried after write buffer maximum size is increased or after data in the buffer has been processed by QIODevice.
\value WriteFailed
Write error occurred ( QIODevice::write() returned -1 ).
\value WriteFailedReturnedZero
@@ -139,7 +144,7 @@ QJsonStream::~QJsonStream()
*/
/*!
- Returns the error the last operation produced, or NoError error if the last operation did not produce an error.
+ Returns the error code of the last stream operation, or NoError if the last operation did not produce an error.
*/
QJsonStream::QJsonStreamError QJsonStream::lastError() const
{
@@ -147,8 +152,8 @@ QJsonStream::QJsonStreamError QJsonStream::lastError() const
}
/*!
- This function checks for the existence of a \c QIODevice and
- returns whether or not it is \c atEnd()
+ If device() is non-zero, returns the result of QIODevice::atEnd() for the device,
+ else returns false.
*/
bool QJsonStream::atEnd() const
@@ -158,10 +163,9 @@ bool QJsonStream::atEnd() const
}
/*!
- This function checks for the existence of a \c QIODevice and
- returns whether or not it is \c isOpen()
+ If device() is non-zero, returns the result of QIODevice::isOpen() for the device,
+ else returns false.
*/
-
bool QJsonStream::isOpen() const
{
Q_D(const QJsonStream);
@@ -180,7 +184,7 @@ QIODevice * QJsonStream::device() const
/*!
Set the \a device used by the QJsonStream.
- Setting the device to 0 disconnects the stream but does not close
+ Setting the device to 0 disconnects the stream from the device but does not close
the device nor flush it.
The stream does not take ownership of the device.
@@ -253,6 +257,7 @@ bool QJsonStream::send(const QJsonObject& object)
/*!
\internal
Send raw QByteArray \a byteArray data over the socket.
+ Returns \b true if data was sent or buffered, \b false otherwise.
*/
bool QJsonStream::sendInternal(const QByteArray& byteArray)
{
@@ -366,7 +371,7 @@ void QJsonStream::setFormat( EncodingFormat format )
}
/*!
- Returns a maximum size of the inbound message buffer.
+ Returns the maximum size of the inbound message buffer.
*/
qint64 QJsonStream::readBufferSize() const
{
@@ -375,8 +380,8 @@ qint64 QJsonStream::readBufferSize() const
}
/*!
- Sets a maximum size of the inbound message buffer to \a sz thus capping a size
- of an inbound message.
+ Sets the maximum size of the inbound message buffer to \a sz thus capping a size
+ of an inbound message. A value of 0 means the buffer size is unlimited.
*/
void QJsonStream::setReadBufferSize(qint64 sz)
{
@@ -387,7 +392,7 @@ void QJsonStream::setReadBufferSize(qint64 sz)
}
/*!
- Returns a maximum size of the outbound message buffer. A value of 0
+ Returns the maximum size of the outbound message buffer. A value of 0
means the buffer size is unlimited.
*/
qint64 QJsonStream::writeBufferSize() const
@@ -409,7 +414,7 @@ void QJsonStream::setWriteBufferSize(qint64 sz)
}
/*!
- Returns a number of bytes currently in the write buffer. Effectively,
+ Returns the number of bytes currently in the write buffer. Effectively,
if \l{writeBufferSize()} is not unlimited, the largest message you can
send at any one time is (\l{writeBufferSize()} - \b bytesToWrite()) bytes.
*/
@@ -440,7 +445,8 @@ bool QJsonStream::messageAvailable()
}
/*!
- internal
+ \internal
+ Sets whether access to the internal buffer should be protected with a mutex.
*/
void QJsonStream::setThreadProtection(bool enable) const
{
diff --git a/src/jsonstream/qjsontokenauthority.cpp b/src/jsonstream/qjsontokenauthority.cpp
index 750dd5e..2a1747a 100644
--- a/src/jsonstream/qjsontokenauthority.cpp
+++ b/src/jsonstream/qjsontokenauthority.cpp
@@ -47,6 +47,7 @@ QT_BEGIN_NAMESPACE_JSONSTREAM
/*!
\class QJsonTokenAuthority
+ \inmodule QtJsonStream
\brief The QJsonTokenAuthority class implements a token-based authentication scheme for QJsonServer.
The QJsonTokenAuthority class authorizes QJson client connections based on tokens received from the first
diff --git a/src/jsonstream/qjsonuidauthority.cpp b/src/jsonstream/qjsonuidauthority.cpp
index 239d93d..3847c7b 100644
--- a/src/jsonstream/qjsonuidauthority.cpp
+++ b/src/jsonstream/qjsonuidauthority.cpp
@@ -55,6 +55,7 @@ QT_BEGIN_NAMESPACE_JSONSTREAM
/*!
\class QJsonUIDAuthority
+ \inmodule QtJsonStream
\brief The QJsonUIDAuthority class implements a UID-based authentication scheme for QJsonServer.
The QJsonUIDAuthority class authorizes QJson client connections based on the user ID of the
diff --git a/src/jsonstream/qjsonuidrangeauthority.cpp b/src/jsonstream/qjsonuidrangeauthority.cpp
index f65488f..4a6de18 100644
--- a/src/jsonstream/qjsonuidrangeauthority.cpp
+++ b/src/jsonstream/qjsonuidrangeauthority.cpp
@@ -55,6 +55,7 @@ QT_BEGIN_NAMESPACE_JSONSTREAM
/*!
\class QJsonUIDRangeAuthority
+ \inmodule QtJsonStream
\brief The QJsonUIDRangeAuthority class authorizes clients that fall within a range of UID values.
The QJsonUIDRangeAuthority class authorizes QJson client connections based on the user ID of the
diff --git a/src/jsonstream/qtjsonschema/qjsonschemaerror.cpp b/src/jsonstream/qtjsonschema/qjsonschemaerror.cpp
index 1258657..2506009 100644
--- a/src/jsonstream/qtjsonschema/qjsonschemaerror.cpp
+++ b/src/jsonstream/qtjsonschema/qjsonschemaerror.cpp
@@ -54,6 +54,7 @@ const QString QJsonSchemaError::kErrorPrefixStr = QString::fromLatin1("::");
/*!
\class QJsonSchemaError
+ \inmodule QtJsonStream
\brief The QJsonSchemaError class details error conditions from parsing or
validating JSON objects and schemas.
diff --git a/src/jsonstream/qtjsonschema/qjsonschemavalidator.cpp b/src/jsonstream/qtjsonschema/qjsonschemavalidator.cpp
index 8cc3810..5e72d95 100644
--- a/src/jsonstream/qtjsonschema/qjsonschemavalidator.cpp
+++ b/src/jsonstream/qtjsonschema/qjsonschemavalidator.cpp
@@ -83,7 +83,7 @@ public:
/*!
\class QJsonSchemaValidator
-
+ \inmodule QtJsonStream
\brief The QJsonSchemaValidator class validates JSON objects against JSON schemas
QJsonSchemaValidator validates JSON objects against JSON schemas. Schemas are loaded
@@ -531,6 +531,7 @@ QJsonObject QJsonSchemaValidator::setSchema(const QString &schemaName, QJsonObje
/*!
\class QJsonSchemaValidator::SchemaNameMatcher
+ \inmodule QtJsonStream
\brief The SchemaNameMatcher class is an abstract class that provides schema matching
functionality to a QJsonSchemaValidator object.
@@ -614,7 +615,7 @@ QJsonObject QJsonSchemaValidator::setSchema(const QString &schemaName, QJsonObje
/*!
\class QJsonSchemaValidator::SchemaPropertyNameMatcher
-
+ \inmodule QtJsonStream
\brief The SchemaPropertyNameMatcher class implements a name matcher for the case when
a property in the JSON object contains the name of a schema that should be used to
validate the object.
@@ -660,7 +661,7 @@ QJsonObject QJsonSchemaValidator::setSchema(const QString &schemaName, QJsonObje
/*!
\class QJsonSchemaValidator::SchemaUniqueKeyNameMatcher
-
+ \inmodule QtJsonStream
\brief The SchemaUniqueKeyNameMatcher class implements a schema name matcher for
the case where schemas contains a uniquely defined top-level key/property pairs
that can be used as a quick index for exact matching schemas.