Added documentation for non private functions.
This commit is contained in:
parent
3941e43e7f
commit
434eaf0ce0
@ -11,12 +11,52 @@
|
|||||||
|
|
||||||
class Database {
|
class Database {
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Checks if an account exists in the database
|
||||||
|
*
|
||||||
|
* @param account The name of the account to check for
|
||||||
|
* @param db The database connection to use
|
||||||
|
*
|
||||||
|
* @return True if the account exists, false otherwise
|
||||||
|
*
|
||||||
|
* @throws std::runtime_error If the database query fails
|
||||||
|
*/
|
||||||
static bool doesAccountExist(const std::string &account, sqlite3 *db);
|
static bool doesAccountExist(const std::string &account, sqlite3 *db);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Deletes an account from the database
|
||||||
|
*
|
||||||
|
* @param account The name of the account to delete
|
||||||
|
* @param db The database connection to use
|
||||||
|
*
|
||||||
|
* @return True if the account was successfully deleted, false otherwise
|
||||||
|
*
|
||||||
|
* @throws std::runtime_error If the database query fails
|
||||||
|
*/
|
||||||
static bool deleteAccount(const std::string &account, sqlite3 *db);
|
static bool deleteAccount(const std::string &account, sqlite3 *db);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Retrieves the cached value of an account from the database
|
||||||
|
*
|
||||||
|
* @param account The name of the account to retrieve the value of
|
||||||
|
* @param db The database connection to use
|
||||||
|
*
|
||||||
|
* @return The cached value of the account
|
||||||
|
*
|
||||||
|
* @throws std::runtime_error If the database query fails or the account doesn't exist
|
||||||
|
*/
|
||||||
static double getValue(const std::string &account, sqlite3 *db);
|
static double getValue(const std::string &account, sqlite3 *db);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Caches the value of an account by calculating the sum of all payments and earnings
|
||||||
|
*
|
||||||
|
* @param accountId The ID of the account to cache the value of
|
||||||
|
* @param db The database connection to use
|
||||||
|
*
|
||||||
|
* @return The cached value of the account
|
||||||
|
*
|
||||||
|
* @throws std::runtime_error If the database query fails
|
||||||
|
*/
|
||||||
static double cacheAccountValue(long long accountId, sqlite3 *db);
|
static double cacheAccountValue(long long accountId, sqlite3 *db);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,8 +12,21 @@
|
|||||||
#include "operation.h"
|
#include "operation.h"
|
||||||
|
|
||||||
namespace Budget::OptHandlers {
|
namespace Budget::OptHandlers {
|
||||||
|
/**
|
||||||
|
* @class MainOptHandler
|
||||||
|
* @brief Handles command line options for the main menu of the budget application
|
||||||
|
*
|
||||||
|
* The MainOptHandler class handles command line options passed to the budget application. It uses the getopt_long function
|
||||||
|
* to parse the options and perform the corresponding actions.
|
||||||
|
*/
|
||||||
class MainOptHandler {
|
class MainOptHandler {
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Constructor for MainOptHandler
|
||||||
|
*
|
||||||
|
* @param argv Vector of arguments passed to the application
|
||||||
|
* @param pSqlite3 The database connection to use
|
||||||
|
*/
|
||||||
explicit MainOptHandler(const std::vector<char *> &argv, sqlite3 *pSqlite3);
|
explicit MainOptHandler(const std::vector<char *> &argv, sqlite3 *pSqlite3);
|
||||||
|
|
||||||
void help();
|
void help();
|
||||||
|
@ -10,6 +10,13 @@
|
|||||||
|
|
||||||
class Utilities {
|
class Utilities {
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Asks the user to confirm an action with a yes or no question
|
||||||
|
*
|
||||||
|
* @param question The question to ask the user
|
||||||
|
*
|
||||||
|
* @return True if the user confirms the action, false otherwise
|
||||||
|
*/
|
||||||
static bool confirm(const std::string &question);
|
static bool confirm(const std::string &question);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user