|
DuxReiNummariae 1.1.0-alpha.19
Simple and powerful budgeting application
|
Namespaces | |
| namespace | detail |
| namespace | internal |
Classes | |
| struct | Clonable |
| Interface for creating polymorphic deep-copyable objects. More... | |
| class | Error |
| Represents an error condition with an associated message and optional supplementary data. More... | |
| struct | LocaleAware |
| A flag to indicate that the operation should be aware of the users' locale. More... | |
| class | ObserverPtr |
| A smart pointer for observing another pointer. This means that it preforms no memory management on the lifetime of the observed pointer. This functionally acts as a marker for other developers that this pointer's does not need to be managed nor can it be accidentally deleted. More... | |
| class | Percentage |
| Represents a percentage value for use in mathematical calculations or user interfaces. More... | |
| class | QtPtr |
| A smart pointer class ensuring the Qt reference counting for automatic memory management. QtPtr is a template-based smart pointer class that ensures Qt's reference counting manages the lifetime of a dynamically allocated object. When the parent owning an object is destroyed or reset, the managed object is automatically deleted. Additionally, when the observed object is destructed, the object observing will turn null. More... | |
| struct | RequireClonable |
| Abstract base class requiring derived classes to implement deep-copy functionality. More... | |
| class | ScopeExecutor |
| Provides a RAII way to execute a bit of code upon the destruction of the object. More... | |
| struct | SpaceCurrency |
| A flag to indicate that the operation should space the currency. More... | |
| class | StrongTypeDef |
| class | StrongTypeDef< WeakType > |
| Creates a strong type that behaves like its underlying weak type form. This is useful for cases where only the type needs to be differentiated, but all behaviour is identical. More... | |
| struct | TruncateZeros |
| A flag to indicate that the operation should truncate implied zeros. More... | |
| class | TypeIndexMap |
| A generic map container of typed-keys to their values. More... | |
| class | UniqueQtPtr |
| A representation of a Qt object that is not handled by the usual Qt memory pattern. When the Qt object derives from a QObject, its deletion is handled on the event loop else it’s deleted immediately upon destruction. More... | |
| struct | WithCurrency |
| A flag to indicate that the operation should be done using the currency code. More... | |
Typedefs | |
| using | PartialDays = std::chrono::duration<double, std::ratio<86400>> |
| A duration type representing partial (fractional) days. | |
| using | TaggedBoolean = StrongTypeDef<bool> |
| A type to represent any tagged Boolean type. | |
Functions | |
| template<typename AsType, typename ObservedType> | |
| AsType & | as (ObserverPtr< ObservedType > observer) |
| Safely casts an observed base type to a specific derived type. | |
| template<typename HaystackType, typename NeedleType> requires std::is_same_v<typename HaystackType::value_type, NeedleType> | |
| bool | contains (const HaystackType &haystack, const NeedleType &needle) |
| Determines whether a specific element exists within a given collection. | |
| DRN_FOUNDATION_EXPORT std::chrono::days | daysBetween (const ::QDate &from, const ::QDate &to) noexcept |
| Calculates the difference in days between two dates. | |
| DRN_FOUNDATION_EXPORT::QDate | firstOfMonth (const ::QDate &date) noexcept |
| Calculates the first day of the month for a given date. | |
| DRN_FOUNDATION_EXPORT::QDate | halfOfMonth (const ::QDate &date) noexcept |
| Calculates the midpoint of the month for a given date. | |
| template<typename IsType, typename ObservedType> | |
| bool | is (const ObserverPtr< ObservedType > &observer) noexcept |
| Safely determines if a base type is of a specific derived type. | |
| template<typename FlagType> | |
| std::enable_if_t< detail::IsRegisteredEnumerationFlag< FlagType >::value, bool > | isSet (const FlagType flag, const FlagType mask) noexcept |
| Checks whether a specific flag is set within a given mask. This determines if a specified flag is active based on the provided mask. It is typically used to evaluate configuration or state flags where binary flags are combined using bitwise operations. | |
| DRN_FOUNDATION_EXPORT::QDate | lastOfMonth (const ::QDate &date) noexcept |
| Calculates the last day of the month for a given date. | |
| template<typename ObjectType, typename BaseType, typename ... ObjectArgTypes> requires internal::IsQtParentableObject<ObjectType> | |
| QtPtr< BaseType > | makeBaseQtPtr (ObjectArgTypes &&... objectArgs) |
| Creates an object using the Qt memory pattern. Guarantees the object is of a Qt type that can participate in the Qt memory management and is owned by a parent. | |
| template<typename ObjectType, typename BaseType, typename ... ObjectArgTypes> requires internal::IsQtType<ObjectType> && internal::IsQtType<BaseType> | |
| UniqueQtPtr< BaseType > | makeBaseUniqueQtPtr (ObjectArgTypes &&... objectArgs) |
| Creates a Qt object that is not handled by the Qt memory pattern. | |
| template<typename QtPtrType> requires internal::IsQtParentableObject<QtPtrType> && std::is_pointer_v<QtPtrType> | |
| QtPtrType | makeOrphan (QtPtrType ptr) |
| Detaches the given Qt pointer from its parent, setting its parent to nullptr. | |
| template<typename ObjectType, typename ... ObjectArgTypes> requires internal::IsQtParentableObject<ObjectType> | |
| QtPtr< ObjectType > | makeQtPtr (ObjectArgTypes &&... objectArgs) |
| Creates an object using the Qt memory pattern. Guarantees the object is of a Qt type that can participate in the Qt memory management and is owned by a parent. | |
| template<typename ObjectType, typename ... ObjectArgTypes> requires internal::IsQtType<ObjectType> | |
| UniqueQtPtr< ObjectType > | makeUniqueQtPtr (ObjectArgTypes &&... objectArgs) |
| Creates a Qt object that is not handled by the Qt memory pattern. | |
| DRN_FOUNDATION_EXPORT std::chrono::months | monthsBetween (const ::QDate &from, const ::QDate &to) noexcept |
| Calculates the number of complete months between two dates. | |
| DRN_FOUNDATION_EXPORT::QString | obfuscate (const ::QString &input) |
| Obfuscates a given string. Useful to obfuscate sensitive information in strings while still showing enough characters to be potentially recognizable. This is particularly useful in logging, debugging, or displaying sensitive data like secrets or passwords without revealing the full value. | |
| DRN_FOUNDATION_EXPORT std::optional<::QString > | obfuscate (const std::optional<::QString > &input) |
| Obfuscates a given string. Useful to obfuscate sensitive information in strings while still showing enough characters to be potentially recognizable. This is particularly useful in logging, debugging, or displaying sensitive data like secrets or passwords without revealing the full value. | |
| template<typename ObservedType, typename ObservedPtrType> | |
| bool | operator!= (const ObservedType *lhs, const ObserverPtr< ObservedPtrType > &rhs) |
| Inequality operator test to determine if a smart pointer is observing a specific naked pointer. | |
| template<typename KeyType, typename ValueType> | |
| bool | operator!= (const TypeIndexMap< KeyType, ValueType > &lhs, const TypeIndexMap< KeyType, ValueType > &rhs) |
| Determines if two type-indexed maps are /not/ identical. | |
| template<typename ObservedType> | |
| bool | operator!= (std::nullptr_t, const ObserverPtr< ObservedType > &rhs) |
| Inequality operator test to determine a pointer that is being observed is null. | |
| template<typename FlagType> | |
| std::enable_if_t< detail::IsRegisteredEnumerationFlag< FlagType >::value, FlagType > | operator& (const FlagType lhs, const FlagType rhs) noexcept |
| Computes the logical AND operation of two flags. This is used to evaluate the intersection of two flags, where a flag is enabled only if it is set in both operands. It simplifies the handling of bitwise operations when working with flags. | |
| DRN_FOUNDATION_EXPORT::QDebug | operator<< (::QDebug out, const Percentage &p) |
| Full object Qt stream insertion operator. | |
| DRN_FOUNDATION_EXPORT::QDebug | operator<< (::QDebug out, const std::chrono::days &val) |
| DRN_FOUNDATION_EXPORT::QDebug | operator<< (::QDebug out, const std::chrono::hours &val) |
| DRN_FOUNDATION_EXPORT::QDebug | operator<< (::QDebug out, const std::chrono::milliseconds &val) |
| DRN_FOUNDATION_EXPORT::QDebug | operator<< (::QDebug out, const std::chrono::months &val) |
| DRN_FOUNDATION_EXPORT::QDebug | operator<< (::QDebug out, const std::chrono::seconds &val) |
| template<typename ValueType> | |
| ::QDebug | operator<< (::QDebug out, const std::optional< ValueType > &opt) |
| template<typename ObservedType> | |
| std::ostream & | operator<< (std::ostream &o, const ObserverPtr< ObservedType > &observer) |
| Stream insertion operator for outputting the contests of the smart pointer. When the smart pointer is observing another pointer, the object pointed to will have its stream insertion operator used. When the smart pointer is null, the stream will be populated with "<nullptr>". | |
| DRN_FOUNDATION_EXPORT std::ostream & | operator<< (std::ostream &out, const Percentage &p) |
| Full object stream insertion operator. | |
| template<typename KeyType, typename ValueType> | |
| std::ostream & | operator<< (std::ostream &out, const TypeIndexMap< KeyType, ValueType > &data) |
| Full object standard output stream insertion operator. | |
| DRN_FOUNDATION_EXPORT std::strong_ordering | operator<=> (const ::QDate &lhs, const ::QDate &rhs) noexcept |
| DRN_FOUNDATION_EXPORT std::strong_ordering | operator<=> (const ::QString &lhs, const ::QString &rhs) noexcept |
| DRN_FOUNDATION_EXPORT std::strong_ordering | operator<=> (const pecunia::Money &lhs, const pecunia::Money &rhs) noexcept |
| template<typename FlagType> | |
| std::enable_if_t< detail::IsRegisteredEnumerationFlag< FlagType >::value, bool > | operator== (const FlagType lhs, const FlagType rhs) noexcept |
| Compares two flag values and determines if they are equal. | |
| template<typename ObservedType, typename ObservedPtrType> | |
| bool | operator== (const ObservedType *lhs, const ObserverPtr< ObservedPtrType > &rhs) |
| Equality operator test to determine if a smart pointer is observing a specific naked pointer. | |
| template<typename ObservedType, typename ObservedPtrType> | |
| bool | operator== (const ObservedType *lhs, const QtPtr< ObservedPtrType > &rhs) |
| template<typename KeyType, typename ValueType> | |
| bool | operator== (const TypeIndexMap< KeyType, ValueType > &lhs, const TypeIndexMap< KeyType, ValueType > &rhs) |
| Determines if two type-indexed maps are identical. | |
| template<typename ObservedType> | |
| bool | operator== (std::nullptr_t, const ObserverPtr< ObservedType > &rhs) |
| Equality operator test to determine a pointer that is being observed is null. | |
| template<typename FlagType> | |
| std::enable_if_t< detail::IsRegisteredEnumerationFlag< FlagType >::value, FlagType > | operator| (const FlagType lhs, const FlagType rhs) noexcept |
| Combines two sets of flags using a logical OR operation. This operation can be used to create a new flag set that contains all flags present in at least one of the inputs. | |
| DRN_FOUNDATION_EXPORT::QString | presentationText (const ::QDate &value) |
| Converts a given object into a human-readable presentation text. | |
| DRN_FOUNDATION_EXPORT::QString | presentationText (const ::qint8 &value) |
| Converts a signed 8-bit integer value into a string representation. | |
| DRN_FOUNDATION_EXPORT::QString | presentationText (const ::quint8 &value) |
| Converts a unsigned 8-bit numeric value into a human-readable presentation text. | |
| DRN_FOUNDATION_EXPORT::QString | presentationText (const pecunia::Currency &code) |
| Converts a supplied currency object into a human-readable presentation text. | |
| DRN_FOUNDATION_EXPORT::QString | presentationText (const pecunia::Currency &code, const SpaceCurrency &shouldBeSpaced) |
| Converts a supplied currency object into a human-readable presentation text with optional spacing. This method formats the given currency object into a string representation that is suitable for display purposes. It accounts for optional spacing based on the provided parameters, making it adaptable for different localization needs. | |
| DRN_FOUNDATION_EXPORT::QString | presentationText (const pecunia::FloatingPoint &value) |
| Converts a floating-point number into a human-readable presentation text for display in GUI elements. | |
| DRN_FOUNDATION_EXPORT::QString | presentationText (const pecunia::Money &money) |
| Converts a supplied money object into its human-readable presentation text. | |
| DRN_FOUNDATION_EXPORT::QString | presentationText (const pecunia::Money &money, const LocaleAware &isLocaleAware, const WithCurrency &shouldAddCurrency) |
| Converts a supplied money object into its human-readable presentation text. | |
| DRN_FOUNDATION_EXPORT::QString | presentationText (const pecunia::Money &money, const LocaleAware &isLocaleAware, const WithCurrency &shouldAddCurrency, const SpaceCurrency &shouldBeSpaced, const TruncateZeros &shouldTruncate) |
| Converts the given money object into a human-readable presentation text based on various formatting options. | |
| DRN_FOUNDATION_EXPORT::QString | presentationText (const pecunia::Money &money, const WithCurrency &shouldAddCurrency) |
| Converts a supplied money object into its human-readable presentation text. | |
| DRN_FOUNDATION_EXPORT::QString | presentationText (const pecunia::Money &money, const WithCurrency &shouldAddCurrency, const SpaceCurrency &shouldBeSpaced) |
| Converts a supplied money object into its human-readable presentation text. | |
| DRN_FOUNDATION_EXPORT::QString | presentationText (const Percentage &p) |
| Generates a text representation for a percentage value. | |
| template<typename ValueType> | |
| ::QString | presentationText (const std::optional< ValueType > &opt) |
| Converts a value to a human-readable text representation. | |
| template<typename ValueType> | |
| ValueType | valueOrDefault (const std::optional< ValueType > &opt) noexcept |
| A convenience function to retrieve a value from an optional. | |
| template<typename ExceptionType, typename ValueType, typename ... ExceptionArgs> | |
| ValueType | valueOrThrow (const std::optional< ValueType > &value, ExceptionArgs ... args) |
| A convenience function to retrieve a value from an optional when it's present. When a value is not present, an exception is thrown. | |
Variables | |
| constexpr PartialDays | daysInMonth {daysInYear.count() / monthsInYear.count()} |
| The average number of days per month, accounting for leap years, in a standard Gregorian calendar year. | |
| constexpr std::chrono::days | daysInWeek {7} |
| The total number of days in a standard Gregorian calendar year. | |
| constexpr PartialDays | daysInYear {365.2425} |
| The average number of days per year, accounting for leap years, in a standard Gregorian calendar year. | |
| constexpr long | displayDigits {3} |
| The number digits after the decimal for displaying floating-point numbers to the user. | |
| constexpr std::chrono::hours | hoursInDay {24} |
| The total number of hours in a day. | |
| constexpr std::chrono::hours | hoursInWeek {hoursInDay.count() * daysInWeek.count()} |
| The total number of hours in a standard Gregorian calendar year. | |
| constexpr std::chrono::months | monthsInYear {12} |
| The total number of months in a standard Gregorian calendar year. | |
| using drn::foundation::PartialDays = std::chrono::duration<double, std::ratio<86400>> |
A duration type representing partial (fractional) days.
This type alias defines a std::chrono::duration that can represent fractional days. The ratio represents the number of seconds in a day (24 hours * 60 minutes * 60 seconds = 86400 seconds).
| using drn::foundation::TaggedBoolean = StrongTypeDef<bool> |
A type to represent any tagged Boolean type.
|
nodiscard |
Safely casts an observed base type to a specific derived type.
| std::bad_cast | Thrown if the base type cannot be cast to the specified derived type. |
| AsType | The derived type to cast the observed instance into. |
| ObservedType | The base type being observed. |
| observer | The instance to cast to a derived type. |
|
nodiscard |
Determines whether a specific element exists within a given collection.
This method checks whether the provided collection (referred to as the "haystack") contains the specified element (referred to as the "needle"). It is designed to standardise and simplify the process of locating elements within collections, providing a utility function that can be reused across various scenarios.
| HaystackType | The type of the collection that contains the data. |
| NeedleType | The type of the element to be searched for. |
| haystack | The collection in which to search for the element. |
| needle | The element to search for within the collection. |
|
nodiscardnoexcept |
Calculates the difference in days between two dates.
This function is useful for determining the number of days between two points in time, which can be used for scheduling, event planning, or calculating durations for reports or metrics.
| from | The starting date for the calculation. |
| to | The ending date for the calculation. |
|
nodiscardnoexcept |
Calculates the first day of the month for a given date.
This function is useful when operations require aligning a date to the start of its month, such as calculating monthly periods, budgeting, or generating reports.
| date | The input date from which the first day of the month is derived. |
|
nodiscardnoexcept |
Calculates the midpoint of the month for a given date.
This function is useful when operations require determining a date approximately halfway through the month, such as splitting periods into early/late segments, creating mid-month reports, or sending out reminders.
| date | The input date from which the midpoint of the month is derived. |
|
nodiscardnoexcept |
Safely determines if a base type is of a specific derived type.
| IsType | The derived type to check if it is being observed. |
| ObservedType | The base type being observed. |
| observer | The instance whose derived type is desired to test. |
|
nodiscardnoexcept |
Checks whether a specific flag is set within a given mask. This determines if a specified flag is active based on the provided mask. It is typically used to evaluate configuration or state flags where binary flags are combined using bitwise operations.
| FlagType | The type of enumeration that describes the possible flags. |
| flag | The specific flag to check. |
| mask | The mask against which the flag is evaluated. |
|
nodiscardnoexcept |
Calculates the last day of the month for a given date.
This function is useful in scenarios where date alignment to the end of the month is required, such as calculating monthly report deadlines, financial summaries, or creating recurring schedules.
| date | The input date from which the last day of the month is derived. |
| QtPtr< BaseType > drn::foundation::makeBaseQtPtr | ( | ObjectArgTypes &&... | objectArgs | ) |
Creates an object using the Qt memory pattern. Guarantees the object is of a Qt type that can participate in the Qt memory management and is owned by a parent.
| ObjectType | The type of the object to create. |
| BaseType | The base type of the object being created. |
| ObjectArgTypes | The argument types for the object constructor to invoke. |
| objectArgs | The values of to use in the object creation. |
| UniqueQtPtr< BaseType > drn::foundation::makeBaseUniqueQtPtr | ( | ObjectArgTypes &&... | objectArgs | ) |
Creates a Qt object that is not handled by the Qt memory pattern.
| ObjectType | The type of the object to create. |
| BaseType | The base type of the object being created. |
| ObjectArgTypes | The argument types for the object constructor to invoke. |
| objectArgs | The values of to use in the object creation. |
| QtPtrType drn::foundation::makeOrphan | ( | QtPtrType | ptr | ) |
Detaches the given Qt pointer from its parent, setting its parent to nullptr.
| QtPtrType | The type of the object to remove the parent. |
| ptr | The Qt pointer to be de-parented. |
| QtPtr< ObjectType > drn::foundation::makeQtPtr | ( | ObjectArgTypes &&... | objectArgs | ) |
Creates an object using the Qt memory pattern. Guarantees the object is of a Qt type that can participate in the Qt memory management and is owned by a parent.
| ObjectType | The type of the object to create. |
| ObjectArgTypes | The argument types for the object constructor to invoke. |
| objectArgs | The values of to use in the object creation. |
| UniqueQtPtr< ObjectType > drn::foundation::makeUniqueQtPtr | ( | ObjectArgTypes &&... | objectArgs | ) |
Creates a Qt object that is not handled by the Qt memory pattern.
| ObjectType | The type of the object to create. |
| ObjectArgTypes | The argument types for the object constructor to invoke. |
| objectArgs | The values of to use in the object creation. |
|
nodiscardnoexcept |
Calculates the number of complete months between two dates.
This function is ideal for determining the duration between two dates in terms of full months.
| from | The starting date for the calculation. |
| to | The ending date for the calculation. |
| DRN_FOUNDATION_EXPORT::QString drn::foundation::obfuscate | ( | const ::QString & | input | ) |
Obfuscates a given string. Useful to obfuscate sensitive information in strings while still showing enough characters to be potentially recognizable. This is particularly useful in logging, debugging, or displaying sensitive data like secrets or passwords without revealing the full value.
| input | The string to be obfuscated. |
| DRN_FOUNDATION_EXPORT std::optional<::QString > drn::foundation::obfuscate | ( | const std::optional<::QString > & | input | ) |
Obfuscates a given string. Useful to obfuscate sensitive information in strings while still showing enough characters to be potentially recognizable. This is particularly useful in logging, debugging, or displaying sensitive data like secrets or passwords without revealing the full value.
| input | The string to be obfuscated. |
| bool drn::foundation::operator!= | ( | const ObservedType * | lhs, |
| const ObserverPtr< ObservedPtrType > & | rhs ) |
Inequality operator test to determine if a smart pointer is observing a specific naked pointer.
| ObservedType | The type of the naked pointer that is to be tested for being observed. |
| ObservedPtrType | The type of the smart pointer that is to be tested for observing. |
| lhs | The naked pointer to test for being observed. |
| rhs | The smart pointer to test for observing. |
| bool drn::foundation::operator!= | ( | const TypeIndexMap< KeyType, ValueType > & | lhs, |
| const TypeIndexMap< KeyType, ValueType > & | rhs ) |
Determines if two type-indexed maps are /not/ identical.
| KeyType | The type for the typed-key. |
| ValueType | The type for the values to store under the typed-key |
| lhs | The left-hand side to compare. |
| rhs | The right-hand side to compare against. |
| bool drn::foundation::operator!= | ( | std::nullptr_t | , |
| const ObserverPtr< ObservedType > & | rhs ) |
Inequality operator test to determine a pointer that is being observed is null.
| ObservedType | The type of the pointer being observed. |
| rhs | The object to test if it is null. |
|
nodiscardnoexcept |
Computes the logical AND operation of two flags. This is used to evaluate the intersection of two flags, where a flag is enabled only if it is set in both operands. It simplifies the handling of bitwise operations when working with flags.
| FlagType | The type of enumeration that describes the possible flags. |
| lhs | The first flag to be evaluated. |
| rhs | The second flag to be evaluated. |
| DRN_FOUNDATION_EXPORT::QDebug drn::foundation::operator<< | ( | ::QDebug | out, |
| const Percentage & | p ) |
Full object Qt stream insertion operator.
| out | The stream to place the data into. |
| p | The data to place into the stream. |
| DRN_FOUNDATION_EXPORT::QDebug drn::foundation::operator<< | ( | ::QDebug | out, |
| const std::chrono::days & | val ) |
| DRN_FOUNDATION_EXPORT::QDebug drn::foundation::operator<< | ( | ::QDebug | out, |
| const std::chrono::hours & | val ) |
| DRN_FOUNDATION_EXPORT::QDebug drn::foundation::operator<< | ( | ::QDebug | out, |
| const std::chrono::milliseconds & | val ) |
| DRN_FOUNDATION_EXPORT::QDebug drn::foundation::operator<< | ( | ::QDebug | out, |
| const std::chrono::months & | val ) |
| DRN_FOUNDATION_EXPORT::QDebug drn::foundation::operator<< | ( | ::QDebug | out, |
| const std::chrono::seconds & | val ) |
| ::QDebug drn::foundation::operator<< | ( | ::QDebug | out, |
| const std::optional< ValueType > & | opt ) |
| std::ostream & drn::foundation::operator<< | ( | std::ostream & | o, |
| const ObserverPtr< ObservedType > & | observer ) |
Stream insertion operator for outputting the contests of the smart pointer. When the smart pointer is observing another pointer, the object pointed to will have its stream insertion operator used. When the smart pointer is null, the stream will be populated with "<nullptr>".
| ObservedType | The type the smart pointer is observing. |
| o | The stream to place the contents into. |
| observer | The smart pointer to output. |
| DRN_FOUNDATION_EXPORT std::ostream & drn::foundation::operator<< | ( | std::ostream & | out, |
| const Percentage & | p ) |
Full object stream insertion operator.
| out | The stream to place the data into. |
| p | The data to place into the stream. |
| std::ostream & drn::foundation::operator<< | ( | std::ostream & | out, |
| const TypeIndexMap< KeyType, ValueType > & | data ) |
Full object standard output stream insertion operator.
| out | The stream to place the data into. |
| data | The data to place into the stream. |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
Compares two flag values and determines if they are equal.
| FlagType | The type of enumeration that describes the possible flags. |
| lhs | The first flag to be compared. |
| rhs | The second flag to be compared. |
| bool drn::foundation::operator== | ( | const ObservedType * | lhs, |
| const ObserverPtr< ObservedPtrType > & | rhs ) |
Equality operator test to determine if a smart pointer is observing a specific naked pointer.
| ObservedType | The type of the naked pointer that is to be tested for being observed. |
| ObservedPtrType | The type of the smart pointer that is to be tested for observing. |
| lhs | The naked pointer to test for being observed. |
| rhs | The smart pointer to test for observing. |
| bool drn::foundation::operator== | ( | const ObservedType * | lhs, |
| const QtPtr< ObservedPtrType > & | rhs ) |
Equality operator for comparing against a naked type.
| ObservedType | The type of the naked object to compare. |
| ObservedPtrType | The type of the Qt object to compare. |
| lhs | The naked pointer to compare to. |
| rhs | The pointer to compare. |
| bool drn::foundation::operator== | ( | const TypeIndexMap< KeyType, ValueType > & | lhs, |
| const TypeIndexMap< KeyType, ValueType > & | rhs ) |
Determines if two type-indexed maps are identical.
| KeyType | The type for the typed-key. |
| ValueType | The type for the values to store under the typed-key |
| lhs | The left-hand side to compare. |
| rhs | The right-hand side to compare against. |
| bool drn::foundation::operator== | ( | std::nullptr_t | , |
| const ObserverPtr< ObservedType > & | rhs ) |
Equality operator test to determine a pointer that is being observed is null.
| ObservedType | The type of the pointer being observed. |
| rhs | The object to test if it is null. |
|
nodiscardnoexcept |
Combines two sets of flags using a logical OR operation. This operation can be used to create a new flag set that contains all flags present in at least one of the inputs.
| FlagType | The type of enumeration that describes the possible flags. |
| lhs | The first set of flags to be included in the resulting combination. |
| rhs | The second set of flags to be included in the resulting combination. |
| DRN_FOUNDATION_EXPORT::QString drn::foundation::presentationText | ( | const ::QDate & | value | ) |
Converts a given object into a human-readable presentation text.
| value | The object to be converted into a human-readable text form. |
| DRN_FOUNDATION_EXPORT::QString drn::foundation::presentationText | ( | const ::qint8 & | value | ) |
Converts a signed 8-bit integer value into a string representation.
| value | The integer value that needs to be converted into a string. |
| DRN_FOUNDATION_EXPORT::QString drn::foundation::presentationText | ( | const ::quint8 & | value | ) |
Converts a unsigned 8-bit numeric value into a human-readable presentation text.
| value | The numeric value to be converted into a human-readable text form. |
| DRN_FOUNDATION_EXPORT::QString drn::foundation::presentationText | ( | const pecunia::Currency & | code | ) |
Converts a supplied currency object into a human-readable presentation text.
| code | The currency object to be converted into a human-readable text form. |
| DRN_FOUNDATION_EXPORT::QString drn::foundation::presentationText | ( | const pecunia::Currency & | code, |
| const SpaceCurrency & | shouldBeSpaced ) |
Converts a supplied currency object into a human-readable presentation text with optional spacing. This method formats the given currency object into a string representation that is suitable for display purposes. It accounts for optional spacing based on the provided parameters, making it adaptable for different localization needs.
| code | The currency object to be converted into a human-readable text form. |
| shouldBeSpaced | Indicates whether a space should be inserted between the currency symbol and the amount. |
| DRN_FOUNDATION_EXPORT::QString drn::foundation::presentationText | ( | const pecunia::FloatingPoint & | value | ) |
Converts a floating-point number into a human-readable presentation text for display in GUI elements.
This function formats a floating-point value into a locale-appropriate textual representation, ensuring it is displayed with a fixed precision suitable for graphical user interfaces or other display contexts.
| value | The floating-point value to be converted into a formatted text representation. |
| DRN_FOUNDATION_EXPORT::QString drn::foundation::presentationText | ( | const pecunia::Money & | money | ) |
Converts a supplied money object into its human-readable presentation text.
| money | The object to be converted into human-readable text form. |
| DRN_FOUNDATION_EXPORT::QString drn::foundation::presentationText | ( | const pecunia::Money & | money, |
| const LocaleAware & | isLocaleAware, | ||
| const WithCurrency & | shouldAddCurrency ) |
Converts a supplied money object into its human-readable presentation text.
| money | The object to be converted into human-readable text form. |
| isLocaleAware | Specifies if a locale-specific decimal point should be used. |
| shouldAddCurrency | Specifies if the currency symbol should be included in the output. |
| DRN_FOUNDATION_EXPORT::QString drn::foundation::presentationText | ( | const pecunia::Money & | money, |
| const LocaleAware & | isLocaleAware, | ||
| const WithCurrency & | shouldAddCurrency, | ||
| const SpaceCurrency & | shouldBeSpaced, | ||
| const TruncateZeros & | shouldTruncate ) |
Converts the given money object into a human-readable presentation text based on various formatting options.
| money | The object representing the monetary value to be converted. |
| isLocaleAware | Determines if the conversion should consider locale-aware formatting for decimal points. |
| shouldAddCurrency | Specifies whether the currency symbol should be included in the output string. |
| shouldBeSpaced | Determines if there should be a space between the currency symbol and the monetary value. |
| shouldTruncate | Indicates whether trailing zeros should be removed from the formatted string. |
| DRN_FOUNDATION_EXPORT::QString drn::foundation::presentationText | ( | const pecunia::Money & | money, |
| const WithCurrency & | shouldAddCurrency ) |
Converts a supplied money object into its human-readable presentation text.
| money | The object to be converted into human-readable text form. |
| shouldAddCurrency | Specifies if the currency symbol should be included in the output. |
| DRN_FOUNDATION_EXPORT::QString drn::foundation::presentationText | ( | const pecunia::Money & | money, |
| const WithCurrency & | shouldAddCurrency, | ||
| const SpaceCurrency & | shouldBeSpaced ) |
Converts a supplied money object into its human-readable presentation text.
| money | The object to be converted into human-readable text form. |
| shouldAddCurrency | Specifies if the currency symbol should be included in the output. |
| shouldBeSpaced | Specifies if a space should be added between the amount, and the currency symbol. |
| DRN_FOUNDATION_EXPORT::QString drn::foundation::presentationText | ( | const Percentage & | p | ) |
Generates a text representation for a percentage value.
This function creates a formatted string displaying the percentage value based on the rate and precision defined in the provided percentage object. It is useful for displaying percentage values in a user-readable format, such as in GUIs, logs, or reports.
| p | An object representing the percentage, containing the rate and precision. |
| ::QString drn::foundation::presentationText | ( | const std::optional< ValueType > & | opt | ) |
Converts a value to a human-readable text representation.
This is useful for when you need to display an object's value to an end-user in a GUI element.
| ValueType | The type to format for displaying. It must support a call to the function presentationText. |
| opt | The value to format for displaying. |
|
noexcept |
A convenience function to retrieve a value from an optional.
| ValueType | The type to retrieve when present. The type must have a default constructor. |
| opt | The object containing the value to potentially retrieve. |
| ValueType drn::foundation::valueOrThrow | ( | const std::optional< ValueType > & | value, |
| ExceptionArgs ... | args ) |
A convenience function to retrieve a value from an optional when it's present. When a value is not present, an exception is thrown.
| ValueType | The type to retrieve from the optional. |
| ExceptionType | The type of the exception to throw. |
| ExceptionArgs | The argument types for the thrown exception type. |
| value | The object containing the value to potentially retrieve. |
| args | The arguments for the thrown exception. |
|
inlineconstexpr |
The average number of days per month, accounting for leap years, in a standard Gregorian calendar year.
|
inlineconstexpr |
The total number of days in a standard Gregorian calendar year.
|
inlineconstexpr |
The average number of days per year, accounting for leap years, in a standard Gregorian calendar year.
|
inlineconstexpr |
The number digits after the decimal for displaying floating-point numbers to the user.
|
inlineconstexpr |
The total number of hours in a day.
|
inlineconstexpr |
The total number of hours in a standard Gregorian calendar year.
|
inlineconstexpr |
The total number of months in a standard Gregorian calendar year.