DuxReiNummariae 1.1.0-alpha.19
Simple and powerful budgeting application
Loading...
Searching...
No Matches
drn::budgeting Namespace Reference

Classes

struct  Bill
 Represents the amount of money that is owed and how often it occurs. More...
struct  BillMap
 Maps all the bills to their source. More...
class  Budget
 Represents a budget management system, allowing creation, modification, and analysis of budgets. More...
class  BudgetedMoney
 Represents a budget item with monetary value that regularly occurs. More...
struct  BudgetedMoneyMap
 Maps all the budgeted monies to their source. More...
struct  BudgetItemAmountDue
 A representation of a budget item due's amount. More...
struct  BudgetItemDueIdentifier
 A representation of a specific budget item that is due. More...
struct  BudgetItemError
 Represents an error while working with a budget item. More...
struct  BudgetItemIdentifier
 Identifies a budget item by its type and source. The structure is used to uniquely represent a budget item by combining its type (e.g., bill, debt, wage) and its source information. More...
class  BudgetSource
 The manager for the information on the source of a budgetary item. More...
struct  BudgetTotals
 Calculates the totals for all budgetary items for a given period. More...
class  Debt
 The representation of an amount of money that is borrowed and how often it occurs. More...
struct  DebtMap
 Maps all the Debts to their source. More...
class  Goal
 The representation of an amount of money that set aside each period for a particular usage. More...
struct  GoalMap
 Maps all the savings goals to their source. More...
struct  Nontrack
 The representation of an amount of money that is meant to be spent but not tracked inside a budget. More...
struct  NontrackMap
 Maps all the nontrack budget items to their source. More...
struct  Wage
 Represents a recurring stream of monetary income, including its periodicity and amount. More...
struct  WageMap
 Maps all the wages that can be received to their source. More...

Functions

DRN_BUDGETING_EXPORT pecunia::Money accumulateOver (const EventFrequency accumulatingAs, const pecunia::Money &amount, const EventFrequency amountPeriod)
 Accumulates a given amount of money per period over another period of time.
DRN_BUDGETING_EXPORT pecunia::Money adjustTo (const EventFrequency adjustingTo, const pecunia::Money &amount, const EventFrequency amountPeriod)
 Adjusts a given amount of money per period to another period. When converting with the "never" frequency, it is considered always to be a zero amount.
DRN_BUDGETING_EXPORT std::vector< BudgetItemAmountDuebudgetItemsDue (const std::chrono::days &within, const Budget &b)
 Finds all budget items that are due within a given time-frame.
DRN_BUDGETING_EXPORT std::set< pecunia::Currency > containedCurrencies (const Budget &b)
 Finds all the unique currencies used throughout the budget.
DRN_BUDGETING_EXPORT double convert (const EventFrequency from, const EventFrequency to)
 Calculates the conversion ratio to get from one event frequency period to another. The "never" frequency conversion ratio is considered to be zero.
DRN_BUDGETING_EXPORT foundation::PartialDays daysIn (const EventFrequency period)
 Calculates the number of days in a period of time.
DRN_BUDGETING_EXPORT const BudgetedMoneyfindBudgetItem (const BudgetItemIdentifier &id, const Budget &b)
 Locates a budget item within a budget using its identifier.
template<typename BudgetItemType>
std::optional< BudgetItemType > findBudgetItem (const BudgetSource &needle, const Budget &haystack)
 Searches for a specific budget item within a budget using a given source as a reference.
template<>
DRN_BUDGETING_EXPORT std::optional< BillfindBudgetItem (const BudgetSource &needle, const Budget &haystack)
 Searches for a specific budget item within a budget using a given source as a reference.
template<>
DRN_BUDGETING_EXPORT std::optional< DebtfindBudgetItem (const BudgetSource &needle, const Budget &haystack)
 Searches for a specific budget item within a budget using a given source as a reference.
template<>
DRN_BUDGETING_EXPORT std::optional< GoalfindBudgetItem (const BudgetSource &needle, const Budget &haystack)
 Searches for a specific budget item within a budget using a given source as a reference.
template<>
DRN_BUDGETING_EXPORT std::optional< NontrackfindBudgetItem (const BudgetSource &needle, const Budget &haystack)
 Searches for a specific budget item within a budget using a given source as a reference.
template<>
DRN_BUDGETING_EXPORT std::optional< WagefindBudgetItem (const BudgetSource &needle, const Budget &haystack)
 Searches for a specific budget item within a budget using a given source as a reference.
DRN_BUDGETING_EXPORT::QDateTime nextTimePoint (const ::QDateTime &current, const EventFrequency &ef)
 Calculates the next time point from a given point using a specific event frequency.
DRN_BUDGETING_EXPORT double occurrencesIn (const EventFrequency period, const ::QDate &from, const ::QDate to)
 Calculates the number of times an event occurs within a specific time range, based on its periodicity and other scheduling constraints such as weekly active hours and days. This function determines how frequent events repeat in the given period.
DRN_BUDGETING_EXPORT::QDebug operator<< (::QDebug out, const BudgetItemAmountDue &data)
 Full object Qt stream insertion operator.
DRN_BUDGETING_EXPORT::QDebug operator<< (::QDebug out, const BudgetItemDueIdentifier &data)
 Full object Qt stream insertion operator.
DRN_BUDGETING_EXPORT::QDebug operator<< (::QDebug out, const BudgetItemIdentifier &data)
 Full object Qt stream insertion operator.
DRN_BUDGETING_EXPORT::QDebug operator<< (::QDebug out, const BudgetSource &data)
 Full object Qt stream insertion operator.
DRN_BUDGETING_EXPORT::QDebug operator<< (::QDebug out, const EventFrequency ef)
 Qt Debug stream insertion operator.
DRN_BUDGETING_EXPORT::QDebug operator<< (::QDebug out, const Wage &data)
 Full object Qt stream insertion operator.
DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &o, const BudgetItemAmountDue &data)
 Full object standard output stream insertion operator.
DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &o, const BudgetItemDueIdentifier &data)
 Full object standard output stream insertion operator.
DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &o, const std::vector< BudgetItemAmountDue > &data)
 Full object standard output stream insertion operator.
DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &out, const Bill &data)
 Full object standard stream insertion operator.
DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &out, const Budget &b)
 Full object stream insertion operator.
DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &out, const BudgetedMoney &data)
 Full object standard stream insertion operator.
DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &out, const BudgetItemIdentifier &data)
 Full object standard output stream insertion operator.
enum DRN_BUDGETING_EXPORT DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &out, const BudgetItemTypes &bit)
 Stream insertion operator for logging purposes.
DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &out, const BudgetSource &data)
 Full object standard stream insertion operator.
DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &out, const Debt &data)
 Full object standard stream insertion operator.
DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &out, const EventFrequency ef)
 Standard stream insertion operator.
DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &out, const Goal &data)
 Full object standard stream insertion operator.
DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &out, const Nontrack &data)
 Full object standard stream insertion operator.
DRN_BUDGETING_EXPORT std::ostream & operator<< (std::ostream &out, const Wage &data)
 Full object standard stream insertion operator.
DRN_BUDGETING_EXPORT::QString presentationText (const BudgetItemIdentifier &bii)
 Generates a text for the identifier of a budget item. The text is formatted to concisely display the source’s name and a description of the item’s type. This is often used for displaying budget item details in textual format in GUI elements or other presentation layers.
DRN_BUDGETING_EXPORT::QString presentationText (const BudgetItemTypes &bit)
 Provides a user-friendly, localized text representation of a budget item type. This function takes a budget item type and converts it into a meaningful, human-readable string. The resulting text is typically localized to ensure it is intuitive to the end user in their preferred language. It is particularly useful for displaying budget item types in a user interface or report.
DRN_BUDGETING_EXPORT::QString presentationText (const BudgetSource &bs)
 Retrieves the textual representation to be displayed on a GUI element or used elsewhere.
DRN_BUDGETING_EXPORT::QString presentationText (const EventFrequency &ef)
 Provides a textual representation, human-readable format of an event frequency.
DRN_BUDGETING_EXPORT void swap (BudgetItemAmountDue &lhs, BudgetItemAmountDue &rhs) noexcept
 Exchanges two objects without any conversion operation performed.
DRN_BUDGETING_EXPORT BudgetItemTypes toBudgetItemTypes (const ::QString &raw)
 Converts a raw string into its corresponding enumeration value.
DRN_BUDGETING_EXPORT BudgetItemTypes toBudgetItemTypes (const BudgetedMoney &money) noexcept
 Converts a monetary budget item into its corresponding budget item type.
DRN_BUDGETING_EXPORT BudgetItemTypes toBudgetItemTypes (const std::type_index &type)
 Converts a type index to its corresponding budget item type.
DRN_BUDGETING_EXPORT EventFrequency toEventFrequency (const ::QString &weak)
 Converts a string representation of an event frequency to its corresponding enumeration value.
DRN_BUDGETING_EXPORT EventFrequency toEventFrequency (const quint8 weak)
 Converts an integer representation of an event frequency to its corresponding enumeration value.
DRN_BUDGETING_EXPORT::QString toWeak (const BudgetItemTypes &bit)
 Translates a value into a weakly-typed English string representation.
enum DRN_BUDGETING_EXPORT DRN_BUDGETING_EXPORT quint8 toWeak (const EventFrequency strong)
 Converts a strong typed enumeration to its corresponding weak type.

Variables

constexpr std::array allBudgetItemTypes
 Provides a complete list of available budget item types.
constexpr std::array allEventFrequencies
 All the possible frequencies at which an event may occur in chronological order.
enum DRN_BUDGETING_EXPORT Annually
 The event will happen once a year.
enum DRN_BUDGETING_EXPORT Biennially
 The event will happen every two years.
enum DRN_BUDGETING_EXPORT Bill
 Represents periodic payment obligations, such as utility or service bills.
enum DRN_BUDGETING_EXPORT Bimonthly
 The event will happen every two months, i.e. six times a year.
enum DRN_BUDGETING_EXPORT BiWeekly
 The event will happen every two weeks, i.e. every 336 hours (14 days).
enum DRN_BUDGETING_EXPORT BudgetItemTypes
 Represents different types of budget-related items for categorization purposes. This defines a variety of budgeting categories, providing a structured way to classify items.
enum DRN_BUDGETING_EXPORT Daily
 The event will happen every day, i.e. every 24 hours.
enum DRN_BUDGETING_EXPORT Debt
 Represents financial liabilities, such as loans or credit balances.
enum DRN_BUDGETING_EXPORT Decennially
 The event will happen every ten years.
enum DRN_BUDGETING_EXPORT EventFrequency
 The available frequencies at which an event may regularly occur. They are in ascending order of time.
enum DRN_BUDGETING_EXPORT Goal
 Represents personal or financial saving objectives.
constexpr int maximumDaysNotifyWithin {60}
 The maximum number of days to notify when a budget item is due.
constexpr int minimumDaysInAWeek {1}
 The minimum number of possible days in a standard calendar work week.
constexpr int minimumDaysNotifyWithin {0}
 The minimum number of days to notify when a budget item is due.
constexpr int minimumHoursInAWeek {1}
 The minimum number of possible hours in a standard calendar work week.
enum DRN_BUDGETING_EXPORT Monthly
 The event will happen once a month.
enum DRN_BUDGETING_EXPORT Never
 The event will never happen.
enum DRN_BUDGETING_EXPORT Nontrack
 Represents items that should not be tracked as part of the budget.
enum DRN_BUDGETING_EXPORT Novennially
 The event will happen every nine years.
enum DRN_BUDGETING_EXPORT Octennially
 The event will happen every eight years.
enum DRN_BUDGETING_EXPORT Quadrennially
 The event will happen every four years.
enum DRN_BUDGETING_EXPORT Quadrimesterly
 The event will happen every four months, i.e. three times a year.
enum DRN_BUDGETING_EXPORT Quarterly
 The event will happen every three months, i.e. four times a year.
enum DRN_BUDGETING_EXPORT Quinquennially
 The event will happen every five years.
enum DRN_BUDGETING_EXPORT Semiannually
 The event will happen every six months, i.e. two times a year.
enum DRN_BUDGETING_EXPORT SemiMonthly
 The event will happen twice a month, i.e. every 360 hours (15 days).
enum DRN_BUDGETING_EXPORT SemiWeekly
 The event will happen roughly twice a week, i.e. every 84 hours (3.5 days).
enum DRN_BUDGETING_EXPORT Septennially
 The event will happen every seven years.
enum DRN_BUDGETING_EXPORT Sexennially
 The event will happen every six years.
enum DRN_BUDGETING_EXPORT Triennially
 The event will happen every three years.
enum DRN_BUDGETING_EXPORT Wage
 Represents income sources, such as salaries or earnings.
enum DRN_BUDGETING_EXPORT Weekly
 The event will happen once a week, i.e. every 168 hours (7 days).

Function Documentation

◆ accumulateOver()

DRN_BUDGETING_EXPORT pecunia::Money drn::budgeting::accumulateOver ( const EventFrequency accumulatingAs,
const pecunia::Money & amount,
const EventFrequency amountPeriod )

Accumulates a given amount of money per period over another period of time.

Exceptions
ErrorWhen either the supplied from or to values are Unknown.
Parameters
accumulatingAsThe frequency period to accumulate an amount over that period of time.
amountThe amount of money to be accumulated.
amountPeriodThe period the amount of money is currently expressed in.
Returns
The accumulated amount as expressed in the new period.

◆ adjustTo()

DRN_BUDGETING_EXPORT pecunia::Money drn::budgeting::adjustTo ( const EventFrequency adjustingTo,
const pecunia::Money & amount,
const EventFrequency amountPeriod )

Adjusts a given amount of money per period to another period. When converting with the "never" frequency, it is considered always to be a zero amount.

Exceptions
ErrorWhen either the supplied from or to values are Unknown.
logic_errorWhen either the from or to values are not known values.
Parameters
adjustingToThe frequency period to convert to.
amountThe amount of money to convert.
amountPeriodThe period the amount of money is currently expressed in.
Returns
The amount as expressed in the new period.

◆ budgetItemsDue()

DRN_BUDGETING_EXPORT std::vector< BudgetItemAmountDue > drn::budgeting::budgetItemsDue ( const std::chrono::days & within,
const Budget & b )

Finds all budget items that are due within a given time-frame.

Parameters
withinThe number of days to search out for a budget item due.
bThe budget to examine.
Returns
All the budget items found to be due in ordered from most due to least due.

◆ containedCurrencies()

DRN_BUDGETING_EXPORT std::set< pecunia::Currency > drn::budgeting::containedCurrencies ( const Budget & b)
nodiscard

Finds all the unique currencies used throughout the budget.

Parameters
bThe budget to examine for currencies.
Returns
Only the unique currencies in the budget.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ convert()

DRN_BUDGETING_EXPORT double drn::budgeting::convert ( const EventFrequency from,
const EventFrequency to )

Calculates the conversion ratio to get from one event frequency period to another. The "never" frequency conversion ratio is considered to be zero.

Exceptions
ErrorWhen either the supplied from or two values are Unknown.
ErrorWhen either the from or to values are not known values.
Parameters
fromThe frequency period to convert from.
toThe frequency period to convert to.
Returns
The ratio that when multiplying the "from" value by it will be equal to the "to" value.

◆ daysIn()

DRN_BUDGETING_EXPORT foundation::PartialDays drn::budgeting::daysIn ( const EventFrequency period)

Calculates the number of days in a period of time.

Exceptions
ErrorWhen the period is not a known value.
Parameters
periodThe frequency period to calculate the number of days in.
Returns
The calculated average number of days for the provided period accounting for leap years.

◆ findBudgetItem() [1/7]

DRN_BUDGETING_EXPORT const BudgetedMoney & drn::budgeting::findBudgetItem ( const BudgetItemIdentifier & id,
const Budget & b )
nodiscard

Locates a budget item within a budget using its identifier.

This function searches through various categories of a budget to find and return the budget item that matches the given identifier.

Exceptions
BudgetItemErrorThrown when the provided identifier does not match any budget item within the budget, with a message indicating that the source does not exist.
Parameters
idThe unique identifier of the budget item to be located.
bThe budget from which the item should be retrieved.
Returns
The budgeted item that matches the identifier.
Here is the call graph for this function:

◆ findBudgetItem() [2/7]

template<typename BudgetItemType>
std::optional< BudgetItemType > drn::budgeting::findBudgetItem ( const BudgetSource & needle,
const Budget & haystack )
nodiscard

Searches for a specific budget item within a budget using a given source as a reference.

Template Parameters
BudgetItemTypeThe type of budget item to search for; should be derived from a base class representing general budgeted components.
Parameters
needleA specific budget source to locate the corresponding budget item for.
haystackA collection representing the budget in which the search will be performed.
Returns
The budget item corresponding to the given source if found, otherwise an empty optional.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findBudgetItem() [3/7]

template<>
DRN_BUDGETING_EXPORT std::optional< Bill > drn::budgeting::findBudgetItem ( const BudgetSource & needle,
const Budget & haystack )
nodiscard

Searches for a specific budget item within a budget using a given source as a reference.

Parameters
needleA specific budget source to locate the corresponding budget item for.
haystackA collection representing the budget in which the search will be performed.
Returns
The budget item corresponding to the given source if found, otherwise an empty optional.
Here is the call graph for this function:

◆ findBudgetItem() [4/7]

template<>
DRN_BUDGETING_EXPORT std::optional< Debt > drn::budgeting::findBudgetItem ( const BudgetSource & needle,
const Budget & haystack )
nodiscard

Searches for a specific budget item within a budget using a given source as a reference.

Parameters
needleA specific budget source to locate the corresponding budget item for.
haystackA collection representing the budget in which the search will be performed.
Returns
The budget item corresponding to the given source if found, otherwise an empty optional.
Here is the call graph for this function:

◆ findBudgetItem() [5/7]

template<>
DRN_BUDGETING_EXPORT std::optional< Goal > drn::budgeting::findBudgetItem ( const BudgetSource & needle,
const Budget & haystack )
nodiscard

Searches for a specific budget item within a budget using a given source as a reference.

Parameters
needleA specific budget source to locate the corresponding budget item for.
haystackA collection representing the budget in which the search will be performed.
Returns
The budget item corresponding to the given source if found, otherwise an empty optional.
Here is the call graph for this function:

◆ findBudgetItem() [6/7]

template<>
DRN_BUDGETING_EXPORT std::optional< Nontrack > drn::budgeting::findBudgetItem ( const BudgetSource & needle,
const Budget & haystack )
nodiscard

Searches for a specific budget item within a budget using a given source as a reference.

Parameters
needleA specific budget source to locate the corresponding budget item for.
haystackA collection representing the budget in which the search will be performed.
Returns
The budget item corresponding to the given source if found, otherwise an empty optional.
Here is the call graph for this function:

◆ findBudgetItem() [7/7]

template<>
DRN_BUDGETING_EXPORT std::optional< Wage > drn::budgeting::findBudgetItem ( const BudgetSource & needle,
const Budget & haystack )
nodiscard

Searches for a specific budget item within a budget using a given source as a reference.

Parameters
needleA specific budget source to locate the corresponding budget item for.
haystackA collection representing the budget in which the search will be performed.
Returns
The budget item corresponding to the given source if found, otherwise an empty optional.
Here is the call graph for this function:

◆ nextTimePoint()

DRN_BUDGETING_EXPORT::QDateTime drn::budgeting::nextTimePoint ( const ::QDateTime & current,
const EventFrequency & ef )

Calculates the next time point from a given point using a specific event frequency.

Exceptions
ErrorWhen the event frequency is not known.
ErrorWhen the current time point is not valid.
Parameters
currentThe current time point to calculate from.
efThe event frequency to calculate the next time point for.
Returns
The calculated time point. If the event is never to happen, the largest possible point in time is given.

◆ occurrencesIn()

DRN_BUDGETING_EXPORT double drn::budgeting::occurrencesIn ( const EventFrequency period,
const ::QDate & from,
const ::QDate to )

Calculates the number of times an event occurs within a specific time range, based on its periodicity and other scheduling constraints such as weekly active hours and days. This function determines how frequent events repeat in the given period.

Precondition
The from input date must be valid.
The to input date must be valid.
Parameters
periodDefines the frequency at which the event occurs.
fromThe start date of the period for which occurrences are being calculated.
toThe end date of the period for which occurrences are being calculated.
Returns
The computed number of occurrences of the event within the specified period. This will be negative if the to date is earlier than the from date.

◆ operator<<() [1/20]

DRN_BUDGETING_EXPORT::QDebug drn::budgeting::operator<< ( ::QDebug out,
const BudgetItemAmountDue & data )

Full object Qt stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [2/20]

DRN_BUDGETING_EXPORT::QDebug drn::budgeting::operator<< ( ::QDebug out,
const BudgetItemDueIdentifier & data )

Full object Qt stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [3/20]

DRN_BUDGETING_EXPORT::QDebug drn::budgeting::operator<< ( ::QDebug out,
const BudgetItemIdentifier & data )

Full object Qt stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [4/20]

DRN_BUDGETING_EXPORT::QDebug drn::budgeting::operator<< ( ::QDebug out,
const BudgetSource & data )

Full object Qt stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [5/20]

DRN_BUDGETING_EXPORT::QDebug drn::budgeting::operator<< ( ::QDebug out,
const EventFrequency ef )

Qt Debug stream insertion operator.

Parameters
outThe output stream where the value will be inserted.
efThe value to be inserted into the stream.
Postcondition
The output buffer contains the contents: Value (ef)
Returns
A reference to the provided output stream.

◆ operator<<() [6/20]

DRN_BUDGETING_EXPORT::QDebug drn::budgeting::operator<< ( ::QDebug out,
const Wage & data )

Full object Qt stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [7/20]

DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & o,
const BudgetItemAmountDue & data )

Full object standard output stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [8/20]

DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & o,
const BudgetItemDueIdentifier & data )

Full object standard output stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [9/20]

DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & o,
const std::vector< BudgetItemAmountDue > & data )

Full object standard output stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [10/20]

DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & out,
const Bill & data )

Full object standard stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.
Here is the caller graph for this function:

◆ operator<<() [11/20]

DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & out,
const Budget & b )

Full object stream insertion operator.

Parameters
outThe stream to place the data into.
bThe data to place into the stream.
Returns
The modified stream after insertion.
Here is the call graph for this function:

◆ operator<<() [12/20]

DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & out,
const BudgetedMoney & data )

Full object standard stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [13/20]

DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & out,
const BudgetItemIdentifier & data )

Full object standard output stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [14/20]

enum DRN_BUDGETING_EXPORT DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & out,
const BudgetItemTypes & bit )

Stream insertion operator for logging purposes.

Parameters
outThe stream to log the values into.
bitThe information to be logged.
Returns
The stream after it is populated with the logging information.

◆ operator<<() [15/20]

DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & out,
const BudgetSource & data )

Full object standard stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [16/20]

DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & out,
const Debt & data )

Full object standard stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [17/20]

DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & out,
const EventFrequency ef )

Standard stream insertion operator.

Parameters
outThe output stream where the value will be inserted.
efThe value to be inserted into the stream.
Postcondition
The output buffer contains the contents: Value (ef)
Returns
A reference to the provided output stream.

◆ operator<<() [18/20]

DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & out,
const Goal & data )

Full object standard stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [19/20]

DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & out,
const Nontrack & data )

Full object standard stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ operator<<() [20/20]

DRN_BUDGETING_EXPORT std::ostream & drn::budgeting::operator<< ( std::ostream & out,
const Wage & data )

Full object standard stream insertion operator.

Parameters
outThe stream to place the data into.
dataThe data to place into the stream.
Returns
The modified stream after insertion.

◆ presentationText() [1/4]

DRN_BUDGETING_EXPORT::QString drn::budgeting::presentationText ( const BudgetItemIdentifier & bii)

Generates a text for the identifier of a budget item. The text is formatted to concisely display the source’s name and a description of the item’s type. This is often used for displaying budget item details in textual format in GUI elements or other presentation layers.

Parameters
biiThe budget item identifier to format.
Returns
The formatted presentation text.
Here is the caller graph for this function:

◆ presentationText() [2/4]

DRN_BUDGETING_EXPORT::QString drn::budgeting::presentationText ( const BudgetItemTypes & bit)
nodiscard

Provides a user-friendly, localized text representation of a budget item type. This function takes a budget item type and converts it into a meaningful, human-readable string. The resulting text is typically localized to ensure it is intuitive to the end user in their preferred language. It is particularly useful for displaying budget item types in a user interface or report.

Parameters
bitThe budget item type to be converted into a localized string representation.
Returns
A localized string representing the given budget item type.

◆ presentationText() [3/4]

DRN_BUDGETING_EXPORT::QString drn::budgeting::presentationText ( const BudgetSource & bs)

Retrieves the textual representation to be displayed on a GUI element or used elsewhere.

This method provides the presentation-ready text that can be displayed in a GUI item or utilised programmatically when a user facing textual description is required.

Returns
A string containing the presentation-ready text for display or further processing.
Here is the call graph for this function:

◆ presentationText() [4/4]

DRN_BUDGETING_EXPORT::QString drn::budgeting::presentationText ( const EventFrequency & ef)

Provides a textual representation, human-readable format of an event frequency.

Parameters
efThe event frequency to convert.
Returns
The textual description of the event frequency.

◆ swap()

DRN_BUDGETING_EXPORT void drn::budgeting::swap ( BudgetItemAmountDue & lhs,
BudgetItemAmountDue & rhs )
noexcept

Exchanges two objects without any conversion operation performed.

Parameters
lhsThe object to swap to the right.
rhsThe object to swap to the left.

◆ toBudgetItemTypes() [1/3]

DRN_BUDGETING_EXPORT BudgetItemTypes drn::budgeting::toBudgetItemTypes ( const ::QString & raw)
nodiscard

Converts a raw string into its corresponding enumeration value.

Exceptions
std::logic_errorWhen the supplied string does not match any known category.
Parameters
rawThe raw string representing a budget category, which may originate from user input, external sources, or localized strings.
Returns
The corresponding value based on the input string.

◆ toBudgetItemTypes() [2/3]

DRN_BUDGETING_EXPORT BudgetItemTypes drn::budgeting::toBudgetItemTypes ( const BudgetedMoney & money)
nodiscardnoexcept

Converts a monetary budget item into its corresponding budget item type.

This function calculates and returns the budget item type based on the input monetary value. It is designed to help categorize budgeted monetary items into meaningful categories for further processing or display in a system. This ensures consistency and accuracy in the classification of budgeted items.

Parameters
moneyThe monetary value to be categorized into a budget item type. This input represents a budgeted amount or entity.
Returns
The budget item type corresponding to the provided monetary value.

◆ toBudgetItemTypes() [3/3]

DRN_BUDGETING_EXPORT BudgetItemTypes drn::budgeting::toBudgetItemTypes ( const std::type_index & type)
nodiscard

Converts a type index to its corresponding budget item type.

Note
N.B. the value BudgetItemTypes::Unknown is explicitly not handled as it cannot be a budget item type.
Exceptions
std::logic_errorWhen the supplied index does not match any known category.
Parameters
typeThe type index of the object or category to be mapped.
Returns
The corresponding budget item type for the specified type index.

◆ toEventFrequency() [1/2]

DRN_BUDGETING_EXPORT EventFrequency drn::budgeting::toEventFrequency ( const ::QString & weak)

Converts a string representation of an event frequency to its corresponding enumeration value.

Exceptions
logic_errorWhen the supplied value cannot be converted.
Parameters
weakA string that represents the event frequency.
Returns
The representing enumeration type equivalent.

◆ toEventFrequency() [2/2]

DRN_BUDGETING_EXPORT EventFrequency drn::budgeting::toEventFrequency ( const quint8 weak)

Converts an integer representation of an event frequency to its corresponding enumeration value.

Exceptions
logic_errorWhen the supplied value cannot be converted.
Parameters
weakAn integer that represents the event frequency.
Returns
The representing enumeration type equivalent.

◆ toWeak() [1/2]

DRN_BUDGETING_EXPORT::QString drn::budgeting::toWeak ( const BudgetItemTypes & bit)
nodiscard

Translates a value into a weakly-typed English string representation.

Parameters
bitThe value to be converted into its English string equivalent.
Returns
An English string representation of the given value.

◆ toWeak() [2/2]

enum DRN_BUDGETING_EXPORT DRN_BUDGETING_EXPORT quint8 drn::budgeting::toWeak ( const EventFrequency strong)

Converts a strong typed enumeration to its corresponding weak type.

Exceptions
logic_errorWhen the supplied value cannot be converted.
Parameters
strongThe strong typed enumeration value to be converted.
Returns
The representing weak type equivalent.

Variable Documentation

◆ allBudgetItemTypes

std::array drn::budgeting::allBudgetItemTypes
inlineconstexpr
Initial value:
{
BudgetItemTypes::Unknown,
BudgetItemTypes::Bill,
BudgetItemTypes::Debt,
BudgetItemTypes::Goal,
BudgetItemTypes::Nontrack,
BudgetItemTypes::Wage
}

Provides a complete list of available budget item types.

◆ allEventFrequencies

std::array drn::budgeting::allEventFrequencies
inlineconstexpr
Initial value:
{
EventFrequency::Unknown,
EventFrequency::Daily,
EventFrequency::SemiWeekly,
EventFrequency::Weekly,
EventFrequency::BiWeekly,
EventFrequency::SemiMonthly,
EventFrequency::Monthly,
EventFrequency::Bimonthly,
EventFrequency::Quarterly,
EventFrequency::Quadrimesterly,
EventFrequency::Semiannually,
EventFrequency::Annually,
EventFrequency::Biennially,
EventFrequency::Triennially,
EventFrequency::Quadrennially,
EventFrequency::Quinquennially,
EventFrequency::Sexennially,
EventFrequency::Septennially,
EventFrequency::Octennially,
EventFrequency::Novennially,
EventFrequency::Decennially,
EventFrequency::Never
}

All the possible frequencies at which an event may occur in chronological order.

◆ Annually

enum DRN_BUDGETING_EXPORT drn::budgeting::Annually

The event will happen once a year.

◆ Biennially

enum DRN_BUDGETING_EXPORT drn::budgeting::Biennially

The event will happen every two years.

◆ Bill

enum DRN_BUDGETING_EXPORT drn::budgeting::Bill

Represents periodic payment obligations, such as utility or service bills.

◆ Bimonthly

enum DRN_BUDGETING_EXPORT drn::budgeting::Bimonthly

The event will happen every two months, i.e. six times a year.

◆ BiWeekly

enum DRN_BUDGETING_EXPORT drn::budgeting::BiWeekly

The event will happen every two weeks, i.e. every 336 hours (14 days).

◆ BudgetItemTypes

enum DRN_BUDGETING_EXPORT drn::budgeting::BudgetItemTypes
strong

Represents different types of budget-related items for categorization purposes. This defines a variety of budgeting categories, providing a structured way to classify items.

◆ Daily

enum DRN_BUDGETING_EXPORT drn::budgeting::Daily

The event will happen every day, i.e. every 24 hours.

◆ Debt

enum DRN_BUDGETING_EXPORT drn::budgeting::Debt

Represents financial liabilities, such as loans or credit balances.

◆ Decennially

enum DRN_BUDGETING_EXPORT drn::budgeting::Decennially

The event will happen every ten years.

◆ EventFrequency

enum DRN_BUDGETING_EXPORT drn::budgeting::EventFrequency
strong

The available frequencies at which an event may regularly occur. They are in ascending order of time.

◆ Goal

enum DRN_BUDGETING_EXPORT drn::budgeting::Goal

Represents personal or financial saving objectives.

◆ maximumDaysNotifyWithin

int drn::budgeting::maximumDaysNotifyWithin {60}
inlineconstexpr

The maximum number of days to notify when a budget item is due.

◆ minimumDaysInAWeek

int drn::budgeting::minimumDaysInAWeek {1}
inlineconstexpr

The minimum number of possible days in a standard calendar work week.

◆ minimumDaysNotifyWithin

int drn::budgeting::minimumDaysNotifyWithin {0}
inlineconstexpr

The minimum number of days to notify when a budget item is due.

◆ minimumHoursInAWeek

int drn::budgeting::minimumHoursInAWeek {1}
inlineconstexpr

The minimum number of possible hours in a standard calendar work week.

◆ Monthly

enum DRN_BUDGETING_EXPORT drn::budgeting::Monthly

The event will happen once a month.

◆ Never

enum DRN_BUDGETING_EXPORT drn::budgeting::Never

The event will never happen.

◆ Nontrack

enum DRN_BUDGETING_EXPORT drn::budgeting::Nontrack

Represents items that should not be tracked as part of the budget.

◆ Novennially

enum DRN_BUDGETING_EXPORT drn::budgeting::Novennially

The event will happen every nine years.

◆ Octennially

enum DRN_BUDGETING_EXPORT drn::budgeting::Octennially

The event will happen every eight years.

◆ Quadrennially

enum DRN_BUDGETING_EXPORT drn::budgeting::Quadrennially

The event will happen every four years.

◆ Quadrimesterly

enum DRN_BUDGETING_EXPORT drn::budgeting::Quadrimesterly

The event will happen every four months, i.e. three times a year.

◆ Quarterly

enum DRN_BUDGETING_EXPORT drn::budgeting::Quarterly

The event will happen every three months, i.e. four times a year.

◆ Quinquennially

enum DRN_BUDGETING_EXPORT drn::budgeting::Quinquennially

The event will happen every five years.

◆ Semiannually

enum DRN_BUDGETING_EXPORT drn::budgeting::Semiannually

The event will happen every six months, i.e. two times a year.

◆ SemiMonthly

enum DRN_BUDGETING_EXPORT drn::budgeting::SemiMonthly

The event will happen twice a month, i.e. every 360 hours (15 days).

◆ SemiWeekly

enum DRN_BUDGETING_EXPORT drn::budgeting::SemiWeekly

The event will happen roughly twice a week, i.e. every 84 hours (3.5 days).

◆ Septennially

enum DRN_BUDGETING_EXPORT drn::budgeting::Septennially

The event will happen every seven years.

◆ Sexennially

enum DRN_BUDGETING_EXPORT drn::budgeting::Sexennially

The event will happen every six years.

◆ Triennially

enum DRN_BUDGETING_EXPORT drn::budgeting::Triennially

The event will happen every three years.

◆ Wage

enum DRN_BUDGETING_EXPORT drn::budgeting::Wage

Represents income sources, such as salaries or earnings.

◆ Weekly

enum DRN_BUDGETING_EXPORT drn::budgeting::Weekly

The event will happen once a week, i.e. every 168 hours (7 days).