diff options
author | Peter Bozsó | 2016-05-28 20:10:38 +0200 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 81c34adaef269524b1f53adcac722aa6a9730075 (patch) | |
tree | da867e32df6a20b06b2e433948e5f94e17ec73f7 /backends/networking/curl | |
parent | f4dfaed19d14c309e44d390b44bff571566779a5 (diff) | |
download | scummvm-rg350-81c34adaef269524b1f53adcac722aa6a9730075.tar.gz scummvm-rg350-81c34adaef269524b1f53adcac722aa6a9730075.tar.bz2 scummvm-rg350-81c34adaef269524b1f53adcac722aa6a9730075.zip |
Fix comment formatting
Diffstat (limited to 'backends/networking/curl')
-rw-r--r-- | backends/networking/curl/connectionmanager.cpp | 2 | ||||
-rw-r--r-- | backends/networking/curl/connectionmanager.h | 30 | ||||
-rw-r--r-- | backends/networking/curl/curljsonrequest.cpp | 2 | ||||
-rw-r--r-- | backends/networking/curl/curljsonrequest.h | 2 | ||||
-rw-r--r-- | backends/networking/curl/curlrequest.cpp | 2 | ||||
-rw-r--r-- | backends/networking/curl/curlrequest.h | 8 | ||||
-rw-r--r-- | backends/networking/curl/networkreadstream.cpp | 2 | ||||
-rw-r--r-- | backends/networking/curl/networkreadstream.h | 62 | ||||
-rw-r--r-- | backends/networking/curl/request.h | 103 |
9 files changed, 105 insertions, 108 deletions
diff --git a/backends/networking/curl/connectionmanager.cpp b/backends/networking/curl/connectionmanager.cpp index 337ad42eba..949dc949f1 100644 --- a/backends/networking/curl/connectionmanager.cpp +++ b/backends/networking/curl/connectionmanager.cpp @@ -131,4 +131,4 @@ void ConnectionManager::processTransfers() { } } -} //end of namespace Cloud +} // End of namespace Cloud diff --git a/backends/networking/curl/connectionmanager.h b/backends/networking/curl/connectionmanager.h index 2d37c0595c..c632fa54ef 100644 --- a/backends/networking/curl/connectionmanager.h +++ b/backends/networking/curl/connectionmanager.h @@ -54,29 +54,29 @@ public: virtual ~ConnectionManager(); /** - * All libcurl transfers are going through this ConnectionManager. - * So, if you want to start any libcurl transfer, you must create - * an easy handle and register it using this method. - */ + * All libcurl transfers are going through this ConnectionManager. + * So, if you want to start any libcurl transfer, you must create + * an easy handle and register it using this method. + */ void registerEasyHandle(CURL *easy); /** - * Use this method to add new Request into manager's queue. - * Manager will periodically call handle() method of these - * Requests until they set their state to FINISHED. - * - * If Request's state is RETRY, handleRetry() is called instead. - * - * @note This method starts the timer if it's not started yet. - * - * @return the same Request pointer, just as a shortcut - */ + * Use this method to add new Request into manager's queue. + * Manager will periodically call handle() method of these + * Requests until they set their state to FINISHED. + * + * If Request's state is RETRY, handleRetry() is called instead. + * + * @note This method starts the timer if it's not started yet. + * + * @return the same Request pointer, just as a shortcut + */ Request *addRequest(Request *request); }; /** Shortcut for accessing the connection manager. */ #define ConnMan Networking::ConnectionManager::instance() -} //end of namespace Networking +} // End of namespace Networking #endif diff --git a/backends/networking/curl/curljsonrequest.cpp b/backends/networking/curl/curljsonrequest.cpp index bc5de60f43..d114d69098 100644 --- a/backends/networking/curl/curljsonrequest.cpp +++ b/backends/networking/curl/curljsonrequest.cpp @@ -95,4 +95,4 @@ void CurlJsonRequest::finish() { finishJson(0); } -} //end of namespace Networking +} // End of namespace Networking diff --git a/backends/networking/curl/curljsonrequest.h b/backends/networking/curl/curljsonrequest.h index 9bd12a13de..5e08be24c9 100644 --- a/backends/networking/curl/curljsonrequest.h +++ b/backends/networking/curl/curljsonrequest.h @@ -52,6 +52,6 @@ public: virtual void finish(); }; -} //end of namespace Networking +} // End of namespace Networking #endif diff --git a/backends/networking/curl/curlrequest.cpp b/backends/networking/curl/curlrequest.cpp index 61af633f21..a745741bc8 100644 --- a/backends/networking/curl/curlrequest.cpp +++ b/backends/networking/curl/curlrequest.cpp @@ -78,4 +78,4 @@ NetworkReadStreamResponse CurlRequest::execute() { return NetworkReadStreamResponse(this, _stream); } -} //end of namespace Networking +} // End of namespace Networking diff --git a/backends/networking/curl/curlrequest.h b/backends/networking/curl/curlrequest.h index f77dce92c0..8623a487d3 100644 --- a/backends/networking/curl/curlrequest.h +++ b/backends/networking/curl/curlrequest.h @@ -60,15 +60,15 @@ public: virtual void addPostField(Common::String field); /** - * Starts this Request with ConnMan. - * @return its NetworkReadStream in NetworkReadStreamResponse. - */ + * Starts this Request with ConnMan. + * @return its NetworkReadStream in NetworkReadStreamResponse. + */ virtual NetworkReadStreamResponse execute(); /** Returns Request's NetworkReadStream. */ const NetworkReadStream *getNetworkReadStream() const { return _stream; } }; -} //end of namespace Networking +} // End of namespace Networking #endif diff --git a/backends/networking/curl/networkreadstream.cpp b/backends/networking/curl/networkreadstream.cpp index 8658fc7d17..997f0b2fc3 100644 --- a/backends/networking/curl/networkreadstream.cpp +++ b/backends/networking/curl/networkreadstream.cpp @@ -85,4 +85,4 @@ long NetworkReadStream::httpResponseCode() const { return responseCode; } -} //end of namespace Cloud +} // End of namespace Cloud diff --git a/backends/networking/curl/networkreadstream.h b/backends/networking/curl/networkreadstream.h index 14c00a4baa..33edade8d7 100644 --- a/backends/networking/curl/networkreadstream.h +++ b/backends/networking/curl/networkreadstream.h @@ -41,48 +41,48 @@ public: virtual ~NetworkReadStream(); /** - * Returns true if a read failed because the stream end has been reached. - * This flag is cleared by clearErr(). - * For a SeekableReadStream, it is also cleared by a successful seek. - * - * @note The semantics of any implementation of this method are - * supposed to match those of ISO C feof(). In particular, in a stream - * with N bytes, reading exactly N bytes from the start should *not* - * set eos; only reading *beyond* the available data should set it. - */ + * Returns true if a read failed because the stream end has been reached. + * This flag is cleared by clearErr(). + * For a SeekableReadStream, it is also cleared by a successful seek. + * + * @note The semantics of any implementation of this method are + * supposed to match those of ISO C feof(). In particular, in a stream + * with N bytes, reading exactly N bytes from the start should *not* + * set eos; only reading *beyond* the available data should set it. + */ virtual bool eos() const; /** - * Read data from the stream. Subclasses must implement this - * method; all other read methods are implemented using it. - * - * @note The semantics of any implementation of this method are - * supposed to match those of ISO C fread(), in particular where - * it concerns setting error and end of file/stream flags. - * - * @param dataPtr pointer to a buffer into which the data is read - * @param dataSize number of bytes to be read - * @return the number of bytes which were actually read. - */ + * Read data from the stream. Subclasses must implement this + * method; all other read methods are implemented using it. + * + * @note The semantics of any implementation of this method are + * supposed to match those of ISO C fread(), in particular where + * it concerns setting error and end of file/stream flags. + * + * @param dataPtr pointer to a buffer into which the data is read + * @param dataSize number of bytes to be read + * @return the number of bytes which were actually read. + */ virtual uint32 read(void *dataPtr, uint32 dataSize); /** - * This method is called by ConnectionManager to indicate - * that transfer is finished. - * - * @note It's called on failure too. - */ + * This method is called by ConnectionManager to indicate + * that transfer is finished. + * + * @note It's called on failure too. + */ void finished(); /** - * Returns HTTP response code from inner CURL handle. - * It returns -1 to indicate there is no inner handle. - * - * @note This method should be called when eos() == true. - */ + * Returns HTTP response code from inner CURL handle. + * It returns -1 to indicate there is no inner handle. + * + * @note This method should be called when eos() == true. + */ long httpResponseCode() const; }; -} //end of namespace Networking +} // End of namespace Networking #endif diff --git a/backends/networking/curl/request.h b/backends/networking/curl/request.h index ff919e02f1..a3c723d218 100644 --- a/backends/networking/curl/request.h +++ b/backends/networking/curl/request.h @@ -31,18 +31,18 @@ namespace Networking { class Request; /** -* Response<T> is a struct to be returned from Request -* to user's callbacks. It's a type safe way to indicate -* which "return value" Request has and user awaits. -* -* It just keeps a Request pointer together with -* some T value (which might be a pointer, a reference -* or a plain type (copied by value)). -* -* To make it more convenient, typedefs are used. -* For example, Response<void *> is called DataResponse -* and corresponding callback pointer is DataCallback. -*/ + * Response<T> is a struct to be returned from Request + * to user's callbacks. It's a type safe way to indicate + * which "return value" Request has and user awaits. + * + * It just keeps a Request pointer together with + * some T value (which might be a pointer, a reference + * or a plain type (copied by value)). + * + * To make it more convenient, typedefs are used. + * For example, Response<void *> is called DataResponse + * and corresponding callback pointer is DataCallback. + */ template<typename T> struct Response { Request *request; @@ -55,27 +55,26 @@ typedef Response<void *> DataReponse; typedef Common::BaseCallback<DataReponse> *DataCallback; /** -* RequestState is used to indicate current Request state. -* ConnectionManager uses it to decide what to do with the Request. -* -* PROCESSING state indicates that Request is working. -* ConnectionManager calls handle() method of Requests in that state. -* -* PAUSED state indicates that Request is not working. -* ConnectionManager keeps Requests in that state and doesn't call any methods of those. -* -* RETRY state indicates that Request must restart after a few seconds. -* ConnectionManager calls handleRetry() method of Requests in that state. -* Default handleRetry() implementation decreases _retryInSeconds value -* until it reaches zero. When it does, Request's restart() method is called. -* -* FINISHED state indicates that Request did the work and might be deleted. -* ConnectionManager deletes Requests in that state. -* After this state is set, but before ConnectionManager deletes the Request, -* Request calls user's callback. User can ask Request to change its state -* by calling retry() or pause() methods and Request won't be deleted. -*/ - + * RequestState is used to indicate current Request state. + * ConnectionManager uses it to decide what to do with the Request. + * + * PROCESSING state indicates that Request is working. + * ConnectionManager calls handle() method of Requests in that state. + * + * PAUSED state indicates that Request is not working. + * ConnectionManager keeps Requests in that state and doesn't call any methods of those. + * + * RETRY state indicates that Request must restart after a few seconds. + * ConnectionManager calls handleRetry() method of Requests in that state. + * Default handleRetry() implementation decreases _retryInSeconds value + * until it reaches zero. When it does, Request's restart() method is called. + * + * FINISHED state indicates that Request did the work and might be deleted. + * ConnectionManager deletes Requests in that state. + * After this state is set, but before ConnectionManager deletes the Request, + * Request calls user's callback. User can ask Request to change its state + * by calling retry() or pause() methods and Request won't be deleted. + */ enum RequestState { PROCESSING, PAUSED, @@ -86,24 +85,22 @@ enum RequestState { class Request { protected: /** - * Callback, which should be called when Request is finished. - * That's the way Requests pass the result to the code which asked to create this request. - * - * @note some Requests use their own callbacks to return something but void *. - * @note callback must be called in finish() or similar method. - */ - + * Callback, which should be called when Request is finished. + * That's the way Requests pass the result to the code which asked to create this request. + * + * @note some Requests use their own callbacks to return something but void *. + * @note callback must be called in finish() or similar method. + */ DataCallback _callback; /** - * Request state, which is used by ConnectionManager to determine - * whether request might be deleted or it's still working. - * - * State might be changed from outside with finish(), pause() or - * retry() methods. Override these if you want to react to these - * changes correctly. - */ - + * Request state, which is used by ConnectionManager to determine + * whether request might be deleted or it's still working. + * + * State might be changed from outside with finish(), pause() or + * retry() methods. Override these if you want to react to these + * changes correctly. + */ RequestState _state; /** In RETRY state this indicates whether it's time to call restart(). */ @@ -132,10 +129,10 @@ public: virtual void pause() { _state = PAUSED; } /** - * Method, which is called to *interrupt* the Request. - * When it's called, Request must stop its work and - * call the callback to notify user of failure. - */ + * Method, which is called to *interrupt* the Request. + * When it's called, Request must stop its work and + * call the callback to notify user of failure. + */ virtual void finish() { _state = FINISHED; } /** Method, which is called to retry the Request. */ @@ -148,6 +145,6 @@ public: RequestState state() const { return _state; } }; -} //end of namespace Cloud +} // End of namespace Cloud #endif |