GnuCash  4.12-527-g05ffd3d4eb
Data Structures | Typedefs | Functions | Variables
gnc-option-impl.hpp File Reference

Implementation templates and specializtions for GncOption values. More...

#include "gnc-option.hpp"
#include <config.h>
#include "qof.h"
#include "Account.h"
#include "gnc-budget.h"
#include "gnc-commodity.h"
#include "gnc-datetime.hpp"
#include <string>
#include <utility>
#include <vector>
#include <exception>
#include <functional>
#include <variant>
#include <iostream>
#include <limits>
#include "gnc-option-uitype.hpp"

Go to the source code of this file.

Data Structures

struct  OptionClassifier
 This class is the parent of all option implmentations. More...
 
class  GncOptionValue< ValueType >
 The generic option-value class. More...
 
class  GncOptionQofInstanceValue
 
class  GncOptionCommodityValue
 class GncOptionCommodityValue Commodities are stored with their namespace and mnemonic instead of their gncGIUD so that they can be correctly retrieved even if they're deleted and recreated. More...
 
struct  is_QofInstanceValue< T >
 
struct  is_QofQueryValue< T >
 
class  GncOptionRangeValue< ValueType >
 Used for numeric ranges and plot sizes. More...
 
class  GncOptionMultichoiceValue
 Multichoice options have a vector of valid options (GncMultichoiceOptionChoices) and validate the selection as being one of those values. More...
 
class  GncOptionAccountListValue
 Set one or more accounts on which to report, optionally restricted to certain account types. More...
 
class  GncOptionAccountSelValue
 
class  GncOptionDateValue
 A legal date value is a pair of either a RelativeDatePeriod, the absolute flag and a time64, or for legacy purposes the absolute flag and a timespec. More...
 

Typedefs

using GncItem = std::pair< QofIdTypeConst, GncGUID >
 
using GncMultichoiceOptionEntry = std::tuple< const std::string, const std::string, GncOptionMultichoiceKeyType >
 
using GncMultichoiceOptionIndexVec = std::vector< uint16_t >
 
using GncMultichoiceOptionChoices = std::vector< GncMultichoiceOptionEntry >
 
using GncOptionAccountList = std::vector< GncGUID >
 
using GncOptionAccountTypeList = std::vector< GNCAccountType >
 

Functions

QofInstanceqof_instance_from_string (const std::string &str, GncOptionUIType type)
 
QofInstanceqof_instance_from_guid (GncGUID *, GncOptionUIType type)
 
std::string qof_instance_to_string (const QofInstance *inst)
 
template<class OptType , typename std::enable_if_t< is_OptionClassifier_v< OptType > &&!(is_QofInstanceValue_v< OptType >||is_RangeValue_v< OptType >), int > = 0>
std::ostream & operator<< (std::ostream &oss, const OptType &opt)
 
template<>
std::ostream & operator<<< GncOptionValue< bool >> (std::ostream &oss, const GncOptionValue< bool > &opt)
 
std::ostream & operator<< (std::ostream &oss, const GncOptionCommodityValue &opt)
 
template<class OptType , typename std::enable_if_t< is_OptionClassifier_v< OptType > &&!(is_QofInstanceValue_v< OptType >||is_RangeValue_v< OptType >), int > = 0>
std::istream & operator>> (std::istream &iss, OptType &opt)
 
std::istream & operator>> (std::istream &iss, GncOptionCommodityValue &opt)
 
template<>
std::istream & operator>>< GncOptionValue< bool >> (std::istream &iss, GncOptionValue< bool > &opt)
 
template<>
std::istream & operator>>< GncOptionValue< GncOptionReportPlacementVec >> (std::istream &iss, GncOptionValue< GncOptionReportPlacementVec > &opt)
 
template<>
std::ostream & operator<<< GncOptionMultichoiceValue > (std::ostream &oss, const GncOptionMultichoiceValue &opt)
 
template<>
std::istream & operator>>< GncOptionMultichoiceValue > (std::istream &iss, GncOptionMultichoiceValue &opt)
 
template<>
std::ostream & operator<<< GncOptionAccountListValue > (std::ostream &oss, const GncOptionAccountListValue &opt)
 
template<>
std::istream & operator>>< GncOptionAccountListValue > (std::istream &iss, GncOptionAccountListValue &opt)
 
template<>
std::ostream & operator<<< GncOptionAccountSelValue > (std::ostream &oss, const GncOptionAccountSelValue &opt)
 
template<>
std::istream & operator>>< GncOptionAccountSelValue > (std::istream &iss, GncOptionAccountSelValue &opt)
 
template<>
std::ostream & operator<<< GncOptionDateValue > (std::ostream &oss, const GncOptionDateValue &opt)
 
template<>
std::istream & operator>>< GncOptionDateValue > (std::istream &iss, GncOptionDateValue &opt)
 

Variables

size_t constexpr classifier_size_max {50}
 
size_t constexpr sort_tag_size_max {10}
 
auto constexpr uint16_t_max = std::numeric_limits<uint16_t>::max()
 
template<typename T >
constexpr bool is_QofInstanceValue_v = is_QofInstanceValue<T>::value
 
template<typename T >
constexpr bool is_QofQueryValue_v = is_QofQueryValue<T>::value
 

Detailed Description

Implementation templates and specializtions for GncOption values.

Objecte created by these templates are wrapped by the GncOption variant.

Author
Copyright 2019-2021 John Ralls jrall.nosp@m.s@ce.nosp@m.ridwe.nosp@m.n.us

Definition in file gnc-option-impl.hpp.