22 #ifndef GNC_QUOTES_HPP 23 #define GNC_QUOTES_HPP 36 using StrVec = std::vector<std::string>;
37 using QuoteSources = StrVec;
39 enum class GncQuoteError
54 using QuoteFailure = std::tuple<std::string, std::string,
55 GncQuoteError, std::string>;
56 using QFVec = std::vector<QuoteFailure>;
79 void fetch (QofBook *book);
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;
Commodity handling public routines (C++ api)
bool had_failures() noexcept
Report if there were quotes requested but not retrieved.
const QFVec & failures() noexcept
Report the commodities for which quotes were requested but not successfully retrieved.
GncQuotes()
Create a GncQuotes object.
Encapsulate all the information about a dataset.
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 std::string & version() noexcept
Get the installed Finance::Quote version.
const QuoteSources & sources() noexcept
Get the available Finance::Quote sources as a std::vector.