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 | |
parent | f4dfaed19d14c309e44d390b44bff571566779a5 (diff) | |
download | scummvm-rg350-81c34adaef269524b1f53adcac722aa6a9730075.tar.gz scummvm-rg350-81c34adaef269524b1f53adcac722aa6a9730075.tar.bz2 scummvm-rg350-81c34adaef269524b1f53adcac722aa6a9730075.zip |
Fix comment formatting
33 files changed, 262 insertions, 278 deletions
diff --git a/backends/cloud/downloadrequest.cpp b/backends/cloud/downloadrequest.cpp index c7f6f75346..8d5e244e45 100644 --- a/backends/cloud/downloadrequest.cpp +++ b/backends/cloud/downloadrequest.cpp @@ -100,4 +100,4 @@ void DownloadRequest::finishBool(bool success) { if (_boolCallback) (*_boolCallback)(Storage::BoolResponse(this, success)); } -} //end of namespace Cloud +} // End of namespace Cloud diff --git a/backends/cloud/downloadrequest.h b/backends/cloud/downloadrequest.h index c9c243be44..0bad5df279 100644 --- a/backends/cloud/downloadrequest.h +++ b/backends/cloud/downloadrequest.h @@ -50,6 +50,6 @@ public: virtual void finish(); }; -} //end of namespace Cloud +} // End of namespace Cloud #endif diff --git a/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp b/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp index 04fbf46ac6..6ea90c150d 100644 --- a/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp +++ b/backends/cloud/dropbox/dropboxlistdirectoryrequest.cpp @@ -136,5 +136,5 @@ void DropboxListDirectoryRequest::finishFiles(Common::Array<StorageFile> &files) if (_filesCallback) (*_filesCallback)(Storage::FileArrayResponse(this, files)); } -} //end of namespace Dropbox -} //end of namespace Cloud +} // End of namespace Dropbox +} // End of namespace Cloud diff --git a/backends/cloud/dropbox/dropboxlistdirectoryrequest.h b/backends/cloud/dropbox/dropboxlistdirectoryrequest.h index e2a9ebf3a4..8539be1e1e 100644 --- a/backends/cloud/dropbox/dropboxlistdirectoryrequest.h +++ b/backends/cloud/dropbox/dropboxlistdirectoryrequest.h @@ -55,7 +55,7 @@ public: virtual void finish(); }; -} //end of namespace Dropbox -} //end of namespace Cloud +} // End of namespace Dropbox +} // End of namespace Cloud #endif diff --git a/backends/cloud/dropbox/dropboxstorage.cpp b/backends/cloud/dropbox/dropboxstorage.cpp index ad6702c967..b1dd865ee2 100644 --- a/backends/cloud/dropbox/dropboxstorage.cpp +++ b/backends/cloud/dropbox/dropboxstorage.cpp @@ -248,5 +248,5 @@ void DropboxStorage::getAccessToken(Common::String code) { ConnMan.addRequest(request); } -} //end of namespace Dropbox -} //end of namespace Cloud +} // End of namespace Dropbox +} // End of namespace Cloud diff --git a/backends/cloud/dropbox/dropboxstorage.h b/backends/cloud/dropbox/dropboxstorage.h index 59dea9d210..da508d7844 100644 --- a/backends/cloud/dropbox/dropboxstorage.h +++ b/backends/cloud/dropbox/dropboxstorage.h @@ -51,17 +51,16 @@ public: virtual ~DropboxStorage(); /** - * Storage methods, which are used by CloudManager to save - * storage in configuration file. - */ + * Storage methods, which are used by CloudManager to save + * storage in configuration file. + */ /** - * Save storage data using ConfMan. - * @param keyPrefix all saved keys must start with this prefix. - * @note every Storage must write keyPrefix + "type" key - * with common value (e.g. "Dropbox"). - */ - + * Save storage data using ConfMan. + * @param keyPrefix all saved keys must start with this prefix. + * @note every Storage must write keyPrefix + "type" key + * with common value (e.g. "Dropbox"). + */ virtual void saveConfig(Common::String keyPrefix); /** Public Cloud API comes down there. */ @@ -106,23 +105,23 @@ public: virtual bool isWorking() { return false; } //TODO /** - * Load token and user id from configs and return DropboxStorage for those. - * @return pointer to the newly created DropboxStorage or 0 if some problem occured. - */ + * Load token and user id from configs and return DropboxStorage for those. + * @return pointer to the newly created DropboxStorage or 0 if some problem occured. + */ static DropboxStorage *loadFromConfig(Common::String keyPrefix); /** - * Returns Dropbox auth link. - */ + * Returns Dropbox auth link. + */ static Common::String getAuthLink(); /** - * Show message with Dropbox auth instructions. (Temporary) - */ + * Show message with Dropbox auth instructions. (Temporary) + */ static void authThroughConsole(); }; -} //end of namespace Dropbox -} //end of namespace Cloud +} // End of namespace Dropbox +} // End of namespace Cloud #endif diff --git a/backends/cloud/folderdownloadrequest.cpp b/backends/cloud/folderdownloadrequest.cpp index cbd3501772..9c2e8b173a 100644 --- a/backends/cloud/folderdownloadrequest.cpp +++ b/backends/cloud/folderdownloadrequest.cpp @@ -115,4 +115,4 @@ void FolderDownloadRequest::finishFiles(Common::Array<StorageFile> &files) { if (_fileArrayCallback) (*_fileArrayCallback)(Storage::FileArrayResponse(this, files)); } -} //end of namespace Cloud +} // End of namespace Cloud diff --git a/backends/cloud/folderdownloadrequest.h b/backends/cloud/folderdownloadrequest.h index 949bcad6ee..33fa5992c6 100644 --- a/backends/cloud/folderdownloadrequest.h +++ b/backends/cloud/folderdownloadrequest.h @@ -54,6 +54,6 @@ public: virtual void finish(); }; -} //end of namespace Cloud +} // End of namespace Cloud #endif diff --git a/backends/cloud/iso8601.cpp b/backends/cloud/iso8601.cpp index 12cbb742b8..3bc169ae85 100644 --- a/backends/cloud/iso8601.cpp +++ b/backends/cloud/iso8601.cpp @@ -87,5 +87,5 @@ uint32 convertToTimestamp(const Common::String &iso8601Date) { return minutes * 60 + s; } -} //end of namespace ISO8601 -} //end of namespace Cloud +} // End of namespace ISO8601 +} // End of namespace Cloud diff --git a/backends/cloud/iso8601.h b/backends/cloud/iso8601.h index a53b3bb501..6e11322cdb 100644 --- a/backends/cloud/iso8601.h +++ b/backends/cloud/iso8601.h @@ -31,7 +31,7 @@ namespace ISO8601 { /** Returns timestamp corresponding to given ISO 8601 date */ uint32 convertToTimestamp(const Common::String &iso8601Date); -} //end of namespace ISO8601 -} //end of namespace Cloud +} // End of namespace ISO8601 +} // End of namespace Cloud #endif diff --git a/backends/cloud/manager.cpp b/backends/cloud/manager.cpp index 9e11f0d4bd..959f395243 100644 --- a/backends/cloud/manager.cpp +++ b/backends/cloud/manager.cpp @@ -105,4 +105,4 @@ void Manager::syncSaves(Storage::BoolCallback callback) { if (storage) storage->syncSaves(callback); } -} //end of namespace Cloud +} // End of namespace Cloud diff --git a/backends/cloud/manager.h b/backends/cloud/manager.h index 08106e0513..6eaf17bc91 100644 --- a/backends/cloud/manager.h +++ b/backends/cloud/manager.h @@ -44,6 +44,6 @@ public: virtual void syncSaves(Storage::BoolCallback callback); }; -} //end of namespace Cloud +} // End of namespace Cloud #endif diff --git a/backends/cloud/onedrive/onedrivelistdirectoryrequest.cpp b/backends/cloud/onedrive/onedrivelistdirectoryrequest.cpp index 2c47852fd1..452c47ac13 100644 --- a/backends/cloud/onedrive/onedrivelistdirectoryrequest.cpp +++ b/backends/cloud/onedrive/onedrivelistdirectoryrequest.cpp @@ -134,5 +134,5 @@ void OneDriveListDirectoryRequest::finishFiles(Common::Array<StorageFile> &files if (_filesCallback) (*_filesCallback)(Storage::FileArrayResponse(this, files)); } -} //end of namespace OneDrive -} //end of namespace Cloud +} // End of namespace OneDrive +} // End of namespace Cloud diff --git a/backends/cloud/onedrive/onedrivelistdirectoryrequest.h b/backends/cloud/onedrive/onedrivelistdirectoryrequest.h index 61eebb2669..ce407c041e 100644 --- a/backends/cloud/onedrive/onedrivelistdirectoryrequest.h +++ b/backends/cloud/onedrive/onedrivelistdirectoryrequest.h @@ -58,7 +58,7 @@ public: virtual void finish(); }; -} //end of namespace OneDrive -} //end of namespace Cloud +} // End of namespace OneDrive +} // End of namespace Cloud #endif diff --git a/backends/cloud/onedrive/onedrivestorage.cpp b/backends/cloud/onedrive/onedrivestorage.cpp index c924dbf093..c8b4ab1ad3 100644 --- a/backends/cloud/onedrive/onedrivestorage.cpp +++ b/backends/cloud/onedrive/onedrivestorage.cpp @@ -271,5 +271,5 @@ void OneDriveStorage::authThroughConsole() { debug("http://wiki.scummvm.org/index.php/User_Manual/Configuring_ScummVM#Using_the_configuration_file_to_configure_ScummVM\n"); } -} //end of namespace OneDrive -} //end of namespace Cloud +} // End of namespace OneDrive +} // End of namespace Cloud diff --git a/backends/cloud/onedrive/onedrivestorage.h b/backends/cloud/onedrive/onedrivestorage.h index 674d13634d..3dc5b7a7ad 100644 --- a/backends/cloud/onedrive/onedrivestorage.h +++ b/backends/cloud/onedrive/onedrivestorage.h @@ -41,9 +41,9 @@ class OneDriveStorage: public Cloud::Storage { OneDriveStorage(Common::String token, Common::String uid, Common::String refreshToken); /** - * This private constructor is called from authThroughConsole() (phase 2). - * It uses OAuth code flow to get tokens. - */ + * This private constructor is called from authThroughConsole() (phase 2). + * It uses OAuth code flow to get tokens. + */ OneDriveStorage(Common::String code); void tokenRefreshed(BoolCallback callback, Networking::JsonResponse pair); @@ -58,17 +58,16 @@ public: virtual ~OneDriveStorage(); /** - * Storage methods, which are used by CloudManager to save - * storage in configuration file. - */ + * Storage methods, which are used by CloudManager to save + * storage in configuration file. + */ /** - * Save storage data using ConfMan. - * @param keyPrefix all saved keys must start with this prefix. - * @note every Storage must write keyPrefix + "type" key - * with common value (e.g. "Dropbox"). - */ - + * Save storage data using ConfMan. + * @param keyPrefix all saved keys must start with this prefix. + * @note every Storage must write keyPrefix + "type" key + * with common value (e.g. "Dropbox"). + */ virtual void saveConfig(Common::String keyPrefix); /** Public Cloud API comes down there. */ @@ -110,32 +109,32 @@ public: virtual bool isWorking() { return false; } //TODO /** - * Load token and user id from configs and return OneDriveStorage for those. - * @return pointer to the newly created OneDriveStorage or 0 if some problem occured. - */ + * Load token and user id from configs and return OneDriveStorage for those. + * @return pointer to the newly created OneDriveStorage or 0 if some problem occured. + */ static OneDriveStorage *loadFromConfig(Common::String keyPrefix); /** - * Returns OneDrive auth link. - */ + * Returns OneDrive auth link. + */ static Common::String getAuthLink(); /** - * Show message with OneDrive auth instructions. (Temporary) - */ + * Show message with OneDrive auth instructions. (Temporary) + */ static void authThroughConsole(); /** - * Gets new access_token. If <code> passed is "", refresh_token is used. - * Use "" in order to refresh token and pass a callback, so you could - * continue your work when new token is available. - */ + * Gets new access_token. If <code> passed is "", refresh_token is used. + * Use "" in order to refresh token and pass a callback, so you could + * continue your work when new token is available. + */ void getAccessToken(BoolCallback callback, Common::String code = ""); Common::String accessToken() { return _token; } }; -} //end of namespace OneDrive -} //end of namespace Cloud +} // End of namespace OneDrive +} // End of namespace Cloud #endif diff --git a/backends/cloud/onedrive/onedrivetokenrefresher.cpp b/backends/cloud/onedrive/onedrivetokenrefresher.cpp index 94214834b0..d932f9ab17 100644 --- a/backends/cloud/onedrive/onedrivetokenrefresher.cpp +++ b/backends/cloud/onedrive/onedrivetokenrefresher.cpp @@ -93,5 +93,5 @@ void OneDriveTokenRefresher::setHeaders(Common::Array<Common::String> &headers) } -} //end of namespace OneDrive -} //end of namespace Cloud +} // End of namespace OneDrive +} // End of namespace Cloud diff --git a/backends/cloud/onedrive/onedrivetokenrefresher.h b/backends/cloud/onedrive/onedrivetokenrefresher.h index 08212bf6f5..90ca9d603a 100644 --- a/backends/cloud/onedrive/onedrivetokenrefresher.h +++ b/backends/cloud/onedrive/onedrivetokenrefresher.h @@ -50,7 +50,7 @@ public: } }; -} //end of namespace OneDrive -} //end of namespace Cloud +} // End of namespace OneDrive +} // End of namespace Cloud #endif diff --git a/backends/cloud/storage.h b/backends/cloud/storage.h index 8009075d0c..ac74f90b57 100644 --- a/backends/cloud/storage.h +++ b/backends/cloud/storage.h @@ -58,7 +58,6 @@ public: * @note every Storage must write keyPrefix + "type" key * with common value (e.g. "Dropbox"). */ - virtual void saveConfig(Common::String keyPrefix) = 0; /** @@ -106,6 +105,6 @@ public: virtual bool isWorking() = 0; }; -} //end of namespace Cloud +} // End of namespace Cloud #endif diff --git a/backends/cloud/storagefile.cpp b/backends/cloud/storagefile.cpp index c0f8d3a9bc..b37b5e0d53 100644 --- a/backends/cloud/storagefile.cpp +++ b/backends/cloud/storagefile.cpp @@ -53,4 +53,4 @@ StorageFile::StorageFile(Common::String pth, uint32 sz, uint32 ts, bool dir) { _isDirectory = dir; } -} //end of namespace Cloud +} // End of namespace Cloud diff --git a/backends/cloud/storagefile.h b/backends/cloud/storagefile.h index ced99fae30..704a03867f 100644 --- a/backends/cloud/storagefile.h +++ b/backends/cloud/storagefile.h @@ -28,11 +28,10 @@ namespace Cloud { /** -* StorageFile represents a file storaged on remote cloud storage. -* It contains basic information about a file, and might be used -* when listing directories or syncing files. -*/ - + * StorageFile represents a file storaged on remote cloud storage. + * It contains basic information about a file, and might be used + * when listing directories or syncing files. + */ class StorageFile { Common::String _path, _name; uint32 _size, _timestamp; @@ -49,6 +48,6 @@ public: bool isDirectory() const { return _isDirectory; } }; -} //end of namespace Cloud +} // End of namespace Cloud #endif diff --git a/backends/cloud/storageinfo.h b/backends/cloud/storageinfo.h index f09563570f..1492898a6c 100644 --- a/backends/cloud/storageinfo.h +++ b/backends/cloud/storageinfo.h @@ -48,6 +48,6 @@ public: }; -} //end of namespace Cloud +} // End of namespace Cloud #endif 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 diff --git a/common/callback.h b/common/callback.h index 4356e4b551..c6c249a511 100644 --- a/common/callback.h +++ b/common/callback.h @@ -26,20 +26,19 @@ namespace Common { /** -* BaseCallback<S> is a simple base class for object-oriented callbacks. -* -* Object-oriented callbacks are such callbacks that know exact instance -* which method must be called. -* -* For backwards compatibility purposes, there is a GlobalFunctionCallback, -* which is BaseCallback<void *>, so it can be used with global C-like -* functions too. -* -* <S> is the type, which is passed to operator() of this callback. -* This allows you to specify that you accept a callback, which wants -* to receive an <S> object. -*/ - + * BaseCallback<S> is a simple base class for object-oriented callbacks. + * + * Object-oriented callbacks are such callbacks that know exact instance + * which method must be called. + * + * For backwards compatibility purposes, there is a GlobalFunctionCallback, + * which is BaseCallback<void *>, so it can be used with global C-like + * functions too. + * + * <S> is the type, which is passed to operator() of this callback. + * This allows you to specify that you accept a callback, which wants + * to receive an <S> object. + */ template<typename S = void *> class BaseCallback { public: BaseCallback() {} @@ -48,13 +47,12 @@ public: }; /** -* GlobalFunctionCallback<T> is a simple wrapper for global C functions. -* -* If there is a method, which accepts BaseCallback<T>, you can -* easily pass your C function by passing -* new GlobalFunctionCallback<T>(yourFunction) -*/ - + * GlobalFunctionCallback<T> is a simple wrapper for global C functions. + * + * If there is a method, which accepts BaseCallback<T>, you can + * easily pass your C function by passing + * new GlobalFunctionCallback<T>(yourFunction) + */ template<typename T> class GlobalFunctionCallback: public BaseCallback<T> { typedef void(*GlobalFunction)(T result); GlobalFunction _callback; @@ -68,20 +66,19 @@ public: }; /** -* Callback<T, S> implements an object-oriented callback. -* -* <T> stands for a class which method you want to call. -* <S>, again, is the type of an object passed to operator(). -* -* So, if you have void MyClass::myMethod(AnotherClass) method, -* the corresponding callback is Callback<MyClass, AnotherClass>. -* You create it similarly to this: -* new Callback<MyClass, AnotherClass>( -* pointerToMyClassObject, -* &MyClass::myMethod -* ) -*/ - + * Callback<T, S> implements an object-oriented callback. + * + * <T> stands for a class which method you want to call. + * <S>, again, is the type of an object passed to operator(). + * + * So, if you have void MyClass::myMethod(AnotherClass) method, + * the corresponding callback is Callback<MyClass, AnotherClass>. + * You create it similarly to this: + * new Callback<MyClass, AnotherClass>( + * pointerToMyClassObject, + * &MyClass::myMethod + * ) + */ template<class T, typename S = void *> class Callback: public BaseCallback<S> { protected: typedef void(T::*TMethod)(S); @@ -94,37 +91,36 @@ public: }; /** -* CallbackBridge<T, OS, S> helps you to chain callbacks. -* -* CallbackBridge keeps a pointer to BaseCallback<OS>. -* When its operator() is called, it passes this pointer -* along with the actual data (of type <S>) to the method -* of <T> class. -* -* This is needed when you have to call a callback only -* when your own callback is called. So, your callback -* is "inner" and the other one is "outer". -* -* CallbackBridge implements the "inner" one and calls -* the method you wanted. It passes the "outer", so you -* can call it from your method. You can ignore it, but -* probably there is no point in using CallbackBridge then. -* -* So, if you receive a BaseCallback<SomeClass> callback -* and you want to call it from your MyClass::myMethod method, -* you should create CallbackBridge<MyClass, SomeClass, S>, -* where <S> is data type you want to receive in MyClass::myMethod. -* -* You create it similarly to this: -* new Callback<MyClass, SomeClass, AnotherClass>( -* pointerToMyClassObject, -* &MyClass::myMethod, -* outerCallback -* ) -* where `outerCallback` is BaseCallback<SomeClass> and `myMethod` is: -* void MyClass::myMethod(BaseCallback<SomeClass> *, AnotherClass) -*/ - + * CallbackBridge<T, OS, S> helps you to chain callbacks. + * + * CallbackBridge keeps a pointer to BaseCallback<OS>. + * When its operator() is called, it passes this pointer + * along with the actual data (of type <S>) to the method + * of <T> class. + * + * This is needed when you have to call a callback only + * when your own callback is called. So, your callback + * is "inner" and the other one is "outer". + * + * CallbackBridge implements the "inner" one and calls + * the method you wanted. It passes the "outer", so you + * can call it from your method. You can ignore it, but + * probably there is no point in using CallbackBridge then. + * + * So, if you receive a BaseCallback<SomeClass> callback + * and you want to call it from your MyClass::myMethod method, + * you should create CallbackBridge<MyClass, SomeClass, S>, + * where <S> is data type you want to receive in MyClass::myMethod. + * + * You create it similarly to this: + * new Callback<MyClass, SomeClass, AnotherClass>( + * pointerToMyClassObject, + * &MyClass::myMethod, + * outerCallback + * ) + * where `outerCallback` is BaseCallback<SomeClass> and `myMethod` is: + * void MyClass::myMethod(BaseCallback<SomeClass> *, AnotherClass) + */ template<class T, typename OS, typename S = void *> class CallbackBridge: public BaseCallback<S> { typedef void(T::*TCallbackMethod)(BaseCallback<OS> *, S); T *_object; diff --git a/common/cloudmanager.h b/common/cloudmanager.h index a480bdf684..350901e35f 100644 --- a/common/cloudmanager.h +++ b/common/cloudmanager.h @@ -33,45 +33,40 @@ public: virtual ~CloudManager() {} /** - * Loads all information from configs and creates current Storage instance. - * - * @note It's called once on startup in scummvm_main(). - */ - + * Loads all information from configs and creates current Storage instance. + * + * @note It's called once on startup in scummvm_main(). + */ virtual void init() = 0; /** - * Saves all information into configuration file. - */ - + * Saves all information into configuration file. + */ virtual void save() = 0; /** - * Adds new Storage into list. - * - * @param storage Cloud::Storage to add. - * @param makeCurrent whether added storage should be the new current storage. - * @param saveConfig whether save() should be called to update configuration file. - */ - + * Adds new Storage into list. + * + * @param storage Cloud::Storage to add. + * @param makeCurrent whether added storage should be the new current storage. + * @param saveConfig whether save() should be called to update configuration file. + */ virtual void addStorage(Cloud::Storage *storage, bool makeCurrent = true, bool saveConfig = true) = 0; /** - * Returns active Storage, which could be used to interact - * with cloud storage. - * - * @return active Cloud::Storage or null, if there is no active Storage. - */ - + * Returns active Storage, which could be used to interact + * with cloud storage. + * + * @return active Cloud::Storage or null, if there is no active Storage. + */ virtual Cloud::Storage *getCurrentStorage() = 0; /** - * Starts saves syncing process in currently active storage if there is any. - */ - + * Starts saves syncing process in currently active storage if there is any. + */ virtual void syncSaves(Cloud::Storage::BoolCallback callback = 0) = 0; }; -} //end of namespace Common +} // End of namespace Common #endif |