Commit ae6cff36 authored by Rafał Malinowski's avatar Rafał Malinowski

core: added documentation for ExecutionArguments classes

Signed-off-by: Rafał Malinowski's avatarRafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
parent ba666cfc
......@@ -26,6 +26,22 @@
class ExecutionArguments;
/**
* @addtogroup Core
* @{
*/
/**
* @class ExecutionArgumentsBuilder
* @short Builder for creating ExecutionArguments instances from simple values.
*
* Example usage:
* auto builder = ExecutionArgumentsBuilder{};
* auto arguments = builder.setQueryVersion(true).setOpenIds(QStringList{} << "gg:1" << "gg:2").build();
*
* will create ExecutionArguments with QueryVersion set to true and two ids in OpenIds fields. All other
* fields will have default values.
*/
class KADUAPI ExecutionArgumentsBuilder final
{
......@@ -38,6 +54,9 @@ public:
ExecutionArgumentsBuilder & setConfigurationDirectory(QString configurationDirectory);
ExecutionArgumentsBuilder & setOpenIds(QStringList openIds);
/**
* @short Create ExecutionArguments from values set before by setXXX methods.
*/
ExecutionArguments build() const;
private:
......@@ -48,3 +67,7 @@ private:
QStringList m_openIds;
};
/**
* @}
*/
......@@ -25,11 +25,32 @@
class ExecutionArguments;
/**
* @addtogroup Core
* @{
*/
/**
* @class ExecutionArgumentsParser
* @short Parser of arguments used to run Kadu.
*
* Parse arguments used to run Kadu into nice and readable ExecutionArguments class.
*/
class KADUAPI ExecutionArgumentsParser final
{
public:
/**
* @short Parse arguments used to run Kadu into nice and readable ExecutionArguments class.
* @param arguments arguments used to run Kadu
*
* Please not that arguments variable should not contain executable name as its first value.
* It should be QCoreApplication::arguments().mid(1) instead of QCoreApplication::arguments().
*/
ExecutionArguments parse(const QStringList &arguments) const;
};
/**
* @}
*/
......@@ -24,16 +24,47 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
/**
* @addtogroup Core
* @{
*/
/**
* @class ExecutionArguments
* @short Arguments used to run Kadu.
*
* All run arguments recognized by Kadu are stored in this class.
*/
class KADUAPI ExecutionArguments final
{
public:
ExecutionArguments(bool queryVersion, bool queryUsage, QString debugMask, QString configurationDirectory, QStringList openIds);
/**
* @return True if version information is requested.
*/
bool queryVersion() const;
/**
* @return True if usage information is requested.
*/
bool queryUsage() const;
/**
* @return Requested value of debug mask.
* @todo change to int
*/
QString debugMask() const;
/**
* @return Requested value of configuation directory.
*/
QString configurationDirectory() const;
/**
* @return Requested list of ids to open chat with.
*/
QStringList openIds() const;
private:
......@@ -44,3 +75,7 @@ private:
QStringList m_openIds;
};
/**
* @}
*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment