From a5871fece38e76d2fba83127cc46153e51aaefd9 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 22 Jan 2026 16:37:49 +0800 Subject: [PATCH] add docstring to cpp-qt methods --- .../resources/cpp-qt-client/api-body.mustache | 46 +++++++++++-------- .../client/PFXFakeApi.cpp | 46 +++++++++++-------- .../client/PFXPetApi.cpp | 46 +++++++++++-------- .../client/PFXPrimitivesApi.cpp | 46 +++++++++++-------- .../client/PFXStoreApi.cpp | 46 +++++++++++-------- .../client/PFXUserApi.cpp | 46 +++++++++++-------- .../petstore/cpp-qt/client/PFXFakeApi.cpp | 46 +++++++++++-------- .../petstore/cpp-qt/client/PFXPetApi.cpp | 46 +++++++++++-------- .../cpp-qt/client/PFXPrimitivesApi.cpp | 46 +++++++++++-------- .../petstore/cpp-qt/client/PFXStoreApi.cpp | 46 +++++++++++-------- .../petstore/cpp-qt/client/PFXUserApi.cpp | 46 +++++++++++-------- 11 files changed, 286 insertions(+), 220 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache index 912067239baa..38172b270edb 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-body.mustache @@ -57,9 +57,9 @@ void {{classname}}::initializeServerConfigs() { } /** -* returns 0 on success and -1, -2 or -3 on failure. -* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found -*/ + * returns 0 on success and -1, -2 or -3 on failure. + * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found + */ int {{classname}}::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); if (it != _serverConfigs.end() && serverIndex < it.value().size()) { @@ -67,6 +67,12 @@ int {{classname}}::setDefaultServerValue(int serverIndex, const QString &operati } return -3; } + +/** + * Sets the server index. + * @param operation The id to the target operation. + * @param serverIndex The server index. + */ void {{classname}}::setServerIndex(const QString &operation, int serverIndex) { if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; @@ -109,13 +115,13 @@ void {{classname}}::setNetworkAccessManager(QNetworkAccessManager* manager) { } /** - * Appends a new ServerConfiguration to the config map for a specific operation. - * @param operation The id to the target operation. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - * returns the index of the new server config on success and -1 if the operation is not found - */ + * Appends a new ServerConfiguration to the config map for a specific operation. + * @param operation The id to the target operation. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * returns the index of the new server config on success and -1 if the operation is not found + */ int {{classname}}::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append({{prefix}}ServerConfiguration( @@ -129,11 +135,11 @@ int {{classname}}::addServerConfiguration(const QString &operation, const QUrl & } /** - * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void {{classname}}::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); @@ -141,11 +147,11 @@ void {{classname}}::setNewServerForAllOperations(const QUrl &url, const QString } /** - * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. - * @param URL A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. + * @param URL A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void {{classname}}::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } diff --git a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXFakeApi.cpp b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXFakeApi.cpp index da0ba60726de..19516440f05c 100644 --- a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXFakeApi.cpp +++ b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXFakeApi.cpp @@ -44,9 +44,9 @@ void PFXFakeApi::initializeServerConfigs() { } /** -* returns 0 on success and -1, -2 or -3 on failure. -* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found -*/ + * returns 0 on success and -1, -2 or -3 on failure. + * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found + */ int PFXFakeApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); if (it != _serverConfigs.end() && serverIndex < it.value().size()) { @@ -54,6 +54,12 @@ int PFXFakeApi::setDefaultServerValue(int serverIndex, const QString &operation, } return -3; } + +/** + * Sets the server index. + * @param operation The id to the target operation. + * @param serverIndex The server index. + */ void PFXFakeApi::setServerIndex(const QString &operation, int serverIndex) { if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; @@ -96,13 +102,13 @@ void PFXFakeApi::setNetworkAccessManager(QNetworkAccessManager* manager) { } /** - * Appends a new ServerConfiguration to the config map for a specific operation. - * @param operation The id to the target operation. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - * returns the index of the new server config on success and -1 if the operation is not found - */ + * Appends a new ServerConfiguration to the config map for a specific operation. + * @param operation The id to the target operation. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * returns the index of the new server config on success and -1 if the operation is not found + */ int PFXFakeApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append(PFXServerConfiguration( @@ -116,11 +122,11 @@ int PFXFakeApi::addServerConfiguration(const QString &operation, const QUrl &url } /** - * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXFakeApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); @@ -128,11 +134,11 @@ void PFXFakeApi::setNewServerForAllOperations(const QUrl &url, const QString &de } /** - * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. - * @param URL A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. + * @param URL A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXFakeApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } diff --git a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPetApi.cpp b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPetApi.cpp index a0683b0d9da1..b414998f9c24 100644 --- a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPetApi.cpp +++ b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPetApi.cpp @@ -60,9 +60,9 @@ void PFXPetApi::initializeServerConfigs() { } /** -* returns 0 on success and -1, -2 or -3 on failure. -* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found -*/ + * returns 0 on success and -1, -2 or -3 on failure. + * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found + */ int PFXPetApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); if (it != _serverConfigs.end() && serverIndex < it.value().size()) { @@ -70,6 +70,12 @@ int PFXPetApi::setDefaultServerValue(int serverIndex, const QString &operation, } return -3; } + +/** + * Sets the server index. + * @param operation The id to the target operation. + * @param serverIndex The server index. + */ void PFXPetApi::setServerIndex(const QString &operation, int serverIndex) { if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; @@ -112,13 +118,13 @@ void PFXPetApi::setNetworkAccessManager(QNetworkAccessManager* manager) { } /** - * Appends a new ServerConfiguration to the config map for a specific operation. - * @param operation The id to the target operation. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - * returns the index of the new server config on success and -1 if the operation is not found - */ + * Appends a new ServerConfiguration to the config map for a specific operation. + * @param operation The id to the target operation. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * returns the index of the new server config on success and -1 if the operation is not found + */ int PFXPetApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append(PFXServerConfiguration( @@ -132,11 +138,11 @@ int PFXPetApi::addServerConfiguration(const QString &operation, const QUrl &url, } /** - * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXPetApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); @@ -144,11 +150,11 @@ void PFXPetApi::setNewServerForAllOperations(const QUrl &url, const QString &des } /** - * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. - * @param URL A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. + * @param URL A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXPetApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } diff --git a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPrimitivesApi.cpp b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPrimitivesApi.cpp index bb9458e59c70..5fbd9a44fd04 100644 --- a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPrimitivesApi.cpp +++ b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXPrimitivesApi.cpp @@ -46,9 +46,9 @@ void PFXPrimitivesApi::initializeServerConfigs() { } /** -* returns 0 on success and -1, -2 or -3 on failure. -* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found -*/ + * returns 0 on success and -1, -2 or -3 on failure. + * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found + */ int PFXPrimitivesApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); if (it != _serverConfigs.end() && serverIndex < it.value().size()) { @@ -56,6 +56,12 @@ int PFXPrimitivesApi::setDefaultServerValue(int serverIndex, const QString &oper } return -3; } + +/** + * Sets the server index. + * @param operation The id to the target operation. + * @param serverIndex The server index. + */ void PFXPrimitivesApi::setServerIndex(const QString &operation, int serverIndex) { if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; @@ -98,13 +104,13 @@ void PFXPrimitivesApi::setNetworkAccessManager(QNetworkAccessManager* manager) { } /** - * Appends a new ServerConfiguration to the config map for a specific operation. - * @param operation The id to the target operation. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - * returns the index of the new server config on success and -1 if the operation is not found - */ + * Appends a new ServerConfiguration to the config map for a specific operation. + * @param operation The id to the target operation. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * returns the index of the new server config on success and -1 if the operation is not found + */ int PFXPrimitivesApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append(PFXServerConfiguration( @@ -118,11 +124,11 @@ int PFXPrimitivesApi::addServerConfiguration(const QString &operation, const QUr } /** - * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXPrimitivesApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); @@ -130,11 +136,11 @@ void PFXPrimitivesApi::setNewServerForAllOperations(const QUrl &url, const QStri } /** - * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. - * @param URL A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. + * @param URL A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXPrimitivesApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } diff --git a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXStoreApi.cpp b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXStoreApi.cpp index 7c99d1f36ce2..fa51b30651cf 100644 --- a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXStoreApi.cpp +++ b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXStoreApi.cpp @@ -50,9 +50,9 @@ void PFXStoreApi::initializeServerConfigs() { } /** -* returns 0 on success and -1, -2 or -3 on failure. -* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found -*/ + * returns 0 on success and -1, -2 or -3 on failure. + * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found + */ int PFXStoreApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); if (it != _serverConfigs.end() && serverIndex < it.value().size()) { @@ -60,6 +60,12 @@ int PFXStoreApi::setDefaultServerValue(int serverIndex, const QString &operation } return -3; } + +/** + * Sets the server index. + * @param operation The id to the target operation. + * @param serverIndex The server index. + */ void PFXStoreApi::setServerIndex(const QString &operation, int serverIndex) { if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; @@ -102,13 +108,13 @@ void PFXStoreApi::setNetworkAccessManager(QNetworkAccessManager* manager) { } /** - * Appends a new ServerConfiguration to the config map for a specific operation. - * @param operation The id to the target operation. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - * returns the index of the new server config on success and -1 if the operation is not found - */ + * Appends a new ServerConfiguration to the config map for a specific operation. + * @param operation The id to the target operation. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * returns the index of the new server config on success and -1 if the operation is not found + */ int PFXStoreApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append(PFXServerConfiguration( @@ -122,11 +128,11 @@ int PFXStoreApi::addServerConfiguration(const QString &operation, const QUrl &ur } /** - * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXStoreApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); @@ -134,11 +140,11 @@ void PFXStoreApi::setNewServerForAllOperations(const QUrl &url, const QString &d } /** - * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. - * @param URL A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. + * @param URL A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXStoreApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } diff --git a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXUserApi.cpp b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXUserApi.cpp index fe8bf4549493..03de0d24022f 100644 --- a/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXUserApi.cpp +++ b/samples/client/petstore/cpp-qt-addDownloadProgress/client/PFXUserApi.cpp @@ -65,9 +65,9 @@ void PFXUserApi::initializeServerConfigs() { } /** -* returns 0 on success and -1, -2 or -3 on failure. -* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found -*/ + * returns 0 on success and -1, -2 or -3 on failure. + * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found + */ int PFXUserApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); if (it != _serverConfigs.end() && serverIndex < it.value().size()) { @@ -75,6 +75,12 @@ int PFXUserApi::setDefaultServerValue(int serverIndex, const QString &operation, } return -3; } + +/** + * Sets the server index. + * @param operation The id to the target operation. + * @param serverIndex The server index. + */ void PFXUserApi::setServerIndex(const QString &operation, int serverIndex) { if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; @@ -117,13 +123,13 @@ void PFXUserApi::setNetworkAccessManager(QNetworkAccessManager* manager) { } /** - * Appends a new ServerConfiguration to the config map for a specific operation. - * @param operation The id to the target operation. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - * returns the index of the new server config on success and -1 if the operation is not found - */ + * Appends a new ServerConfiguration to the config map for a specific operation. + * @param operation The id to the target operation. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * returns the index of the new server config on success and -1 if the operation is not found + */ int PFXUserApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append(PFXServerConfiguration( @@ -137,11 +143,11 @@ int PFXUserApi::addServerConfiguration(const QString &operation, const QUrl &url } /** - * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXUserApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); @@ -149,11 +155,11 @@ void PFXUserApi::setNewServerForAllOperations(const QUrl &url, const QString &de } /** - * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. - * @param URL A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. + * @param URL A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXUserApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } diff --git a/samples/client/petstore/cpp-qt/client/PFXFakeApi.cpp b/samples/client/petstore/cpp-qt/client/PFXFakeApi.cpp index 607463f8816b..6bbd634658c6 100644 --- a/samples/client/petstore/cpp-qt/client/PFXFakeApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXFakeApi.cpp @@ -44,9 +44,9 @@ void PFXFakeApi::initializeServerConfigs() { } /** -* returns 0 on success and -1, -2 or -3 on failure. -* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found -*/ + * returns 0 on success and -1, -2 or -3 on failure. + * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found + */ int PFXFakeApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); if (it != _serverConfigs.end() && serverIndex < it.value().size()) { @@ -54,6 +54,12 @@ int PFXFakeApi::setDefaultServerValue(int serverIndex, const QString &operation, } return -3; } + +/** + * Sets the server index. + * @param operation The id to the target operation. + * @param serverIndex The server index. + */ void PFXFakeApi::setServerIndex(const QString &operation, int serverIndex) { if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; @@ -96,13 +102,13 @@ void PFXFakeApi::setNetworkAccessManager(QNetworkAccessManager* manager) { } /** - * Appends a new ServerConfiguration to the config map for a specific operation. - * @param operation The id to the target operation. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - * returns the index of the new server config on success and -1 if the operation is not found - */ + * Appends a new ServerConfiguration to the config map for a specific operation. + * @param operation The id to the target operation. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * returns the index of the new server config on success and -1 if the operation is not found + */ int PFXFakeApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append(PFXServerConfiguration( @@ -116,11 +122,11 @@ int PFXFakeApi::addServerConfiguration(const QString &operation, const QUrl &url } /** - * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXFakeApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); @@ -128,11 +134,11 @@ void PFXFakeApi::setNewServerForAllOperations(const QUrl &url, const QString &de } /** - * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. - * @param URL A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. + * @param URL A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXFakeApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } diff --git a/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp b/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp index 90d6545c00e4..cb07b0b4718b 100644 --- a/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXPetApi.cpp @@ -60,9 +60,9 @@ void PFXPetApi::initializeServerConfigs() { } /** -* returns 0 on success and -1, -2 or -3 on failure. -* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found -*/ + * returns 0 on success and -1, -2 or -3 on failure. + * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found + */ int PFXPetApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); if (it != _serverConfigs.end() && serverIndex < it.value().size()) { @@ -70,6 +70,12 @@ int PFXPetApi::setDefaultServerValue(int serverIndex, const QString &operation, } return -3; } + +/** + * Sets the server index. + * @param operation The id to the target operation. + * @param serverIndex The server index. + */ void PFXPetApi::setServerIndex(const QString &operation, int serverIndex) { if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; @@ -112,13 +118,13 @@ void PFXPetApi::setNetworkAccessManager(QNetworkAccessManager* manager) { } /** - * Appends a new ServerConfiguration to the config map for a specific operation. - * @param operation The id to the target operation. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - * returns the index of the new server config on success and -1 if the operation is not found - */ + * Appends a new ServerConfiguration to the config map for a specific operation. + * @param operation The id to the target operation. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * returns the index of the new server config on success and -1 if the operation is not found + */ int PFXPetApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append(PFXServerConfiguration( @@ -132,11 +138,11 @@ int PFXPetApi::addServerConfiguration(const QString &operation, const QUrl &url, } /** - * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXPetApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); @@ -144,11 +150,11 @@ void PFXPetApi::setNewServerForAllOperations(const QUrl &url, const QString &des } /** - * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. - * @param URL A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. + * @param URL A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXPetApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } diff --git a/samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.cpp b/samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.cpp index 40fc23277c29..017a8af18239 100644 --- a/samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.cpp @@ -46,9 +46,9 @@ void PFXPrimitivesApi::initializeServerConfigs() { } /** -* returns 0 on success and -1, -2 or -3 on failure. -* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found -*/ + * returns 0 on success and -1, -2 or -3 on failure. + * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found + */ int PFXPrimitivesApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); if (it != _serverConfigs.end() && serverIndex < it.value().size()) { @@ -56,6 +56,12 @@ int PFXPrimitivesApi::setDefaultServerValue(int serverIndex, const QString &oper } return -3; } + +/** + * Sets the server index. + * @param operation The id to the target operation. + * @param serverIndex The server index. + */ void PFXPrimitivesApi::setServerIndex(const QString &operation, int serverIndex) { if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; @@ -98,13 +104,13 @@ void PFXPrimitivesApi::setNetworkAccessManager(QNetworkAccessManager* manager) { } /** - * Appends a new ServerConfiguration to the config map for a specific operation. - * @param operation The id to the target operation. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - * returns the index of the new server config on success and -1 if the operation is not found - */ + * Appends a new ServerConfiguration to the config map for a specific operation. + * @param operation The id to the target operation. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * returns the index of the new server config on success and -1 if the operation is not found + */ int PFXPrimitivesApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append(PFXServerConfiguration( @@ -118,11 +124,11 @@ int PFXPrimitivesApi::addServerConfiguration(const QString &operation, const QUr } /** - * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXPrimitivesApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); @@ -130,11 +136,11 @@ void PFXPrimitivesApi::setNewServerForAllOperations(const QUrl &url, const QStri } /** - * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. - * @param URL A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. + * @param URL A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXPrimitivesApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } diff --git a/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp b/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp index 1e03e475b84d..bf4a5924bf38 100644 --- a/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp @@ -50,9 +50,9 @@ void PFXStoreApi::initializeServerConfigs() { } /** -* returns 0 on success and -1, -2 or -3 on failure. -* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found -*/ + * returns 0 on success and -1, -2 or -3 on failure. + * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found + */ int PFXStoreApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); if (it != _serverConfigs.end() && serverIndex < it.value().size()) { @@ -60,6 +60,12 @@ int PFXStoreApi::setDefaultServerValue(int serverIndex, const QString &operation } return -3; } + +/** + * Sets the server index. + * @param operation The id to the target operation. + * @param serverIndex The server index. + */ void PFXStoreApi::setServerIndex(const QString &operation, int serverIndex) { if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; @@ -102,13 +108,13 @@ void PFXStoreApi::setNetworkAccessManager(QNetworkAccessManager* manager) { } /** - * Appends a new ServerConfiguration to the config map for a specific operation. - * @param operation The id to the target operation. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - * returns the index of the new server config on success and -1 if the operation is not found - */ + * Appends a new ServerConfiguration to the config map for a specific operation. + * @param operation The id to the target operation. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * returns the index of the new server config on success and -1 if the operation is not found + */ int PFXStoreApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append(PFXServerConfiguration( @@ -122,11 +128,11 @@ int PFXStoreApi::addServerConfiguration(const QString &operation, const QUrl &ur } /** - * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXStoreApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); @@ -134,11 +140,11 @@ void PFXStoreApi::setNewServerForAllOperations(const QUrl &url, const QString &d } /** - * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. - * @param URL A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. + * @param URL A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXStoreApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); } diff --git a/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp b/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp index 276d770579b4..a37550d24653 100644 --- a/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXUserApi.cpp @@ -65,9 +65,9 @@ void PFXUserApi::initializeServerConfigs() { } /** -* returns 0 on success and -1, -2 or -3 on failure. -* -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found -*/ + * returns 0 on success and -1, -2 or -3 on failure. + * -1 when the variable does not exist and -2 if the value is not defined in the enum and -3 if the operation or server index is not found + */ int PFXUserApi::setDefaultServerValue(int serverIndex, const QString &operation, const QString &variable, const QString &value) { auto it = _serverConfigs.find(operation); if (it != _serverConfigs.end() && serverIndex < it.value().size()) { @@ -75,6 +75,12 @@ int PFXUserApi::setDefaultServerValue(int serverIndex, const QString &operation, } return -3; } + +/** + * Sets the server index. + * @param operation The id to the target operation. + * @param serverIndex The server index. + */ void PFXUserApi::setServerIndex(const QString &operation, int serverIndex) { if (_serverIndices.contains(operation) && serverIndex < _serverConfigs.find(operation).value().size()) { _serverIndices[operation] = serverIndex; @@ -117,13 +123,13 @@ void PFXUserApi::setNetworkAccessManager(QNetworkAccessManager* manager) { } /** - * Appends a new ServerConfiguration to the config map for a specific operation. - * @param operation The id to the target operation. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - * returns the index of the new server config on success and -1 if the operation is not found - */ + * Appends a new ServerConfiguration to the config map for a specific operation. + * @param operation The id to the target operation. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * returns the index of the new server config on success and -1 if the operation is not found + */ int PFXUserApi::addServerConfiguration(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { if (_serverConfigs.contains(operation)) { _serverConfigs[operation].append(PFXServerConfiguration( @@ -137,11 +143,11 @@ int PFXUserApi::addServerConfiguration(const QString &operation, const QUrl &url } /** - * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. - * @param url A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for a all operations and sets the index to that server. + * @param url A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXUserApi::setNewServerForAllOperations(const QUrl &url, const QString &description, const QMap &variables) { for (auto keyIt = _serverIndices.keyBegin(); keyIt != _serverIndices.keyEnd(); keyIt++) { setServerIndex(*keyIt, addServerConfiguration(*keyIt, url, description, variables)); @@ -149,11 +155,11 @@ void PFXUserApi::setNewServerForAllOperations(const QUrl &url, const QString &de } /** - * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. - * @param URL A string that contains the URL of the server - * @param description A String that describes the server - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ + * Appends a new ServerConfiguration to the config map for an operations and sets the index to that server. + * @param URL A string that contains the URL of the server + * @param description A String that describes the server + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ void PFXUserApi::setNewServer(const QString &operation, const QUrl &url, const QString &description, const QMap &variables) { setServerIndex(operation, addServerConfiguration(operation, url, description, variables)); }