36using StrVec = std::vector<std::string>;
37using QuoteSources = StrVec;
39enum class GncQuoteError
54using QuoteFailure = std::tuple<std::string, std::string,
55 GncQuoteError, std::string>;
56using QFVec = std::vector<QuoteFailure>;
85 void fetch (CommVec& commodities);
91 void fetch (gnc_commodity *comm);
99 void report (
const char* source,
const StrVec& commodities,
bool verbose =
false);
104 const std::string&
version()
noexcept;
110 const QuoteSources&
sources()
noexcept;
133 const std::string report_failures()
noexcept;
136 std::unique_ptr<GncQuotesImpl> m_impl;
bool had_failures() noexcept
Report if there were quotes requested but not retrieved.
void report(const char *source, const StrVec &commodities, bool verbose=false)
Report quote results from Finance::Quote to std::cout.
void fetch(QofBook *book)
Fetch quotes for all commodities in our db that have a quote source set.
const QFVec & failures() noexcept
Report the commodities for which quotes were requested but not successfully retrieved.
GncQuotes()
Create a GncQuotes object.
const std::string & version() noexcept
Get the installed Finance::Quote version.
const QuoteSources & sources() noexcept
Get the available Finance::Quote sources as a std::vector.
Commodity handling public routines (C++ api)
Encapsulate all the information about a dataset.