23#include <ql/currency.hpp>
40 std::set<std::string> minorUnitCodes(tmp.begin(), tmp.end());
42 DLOG(
"Loading external currency configuration for " << isoCode);
53 Rounding rounding(precision, roundingType);
55 rounding, format, minorUnitCodes, currencyType);
56 DLOG(
"loading configuration for currency code " << isoCode);
58 switch (currencyType) {
59 case QuantExt::ConfigurableCurrency::Type::Crypto:
60 CurrencyParser::instance().addCrypto(c.code(), c);
62 case QuantExt::ConfigurableCurrency::Type::Metal:
63 CurrencyParser::instance().addMetal(c.code(), c);
66 CurrencyParser::instance().addCurrency(c.code(), c);
71 }
catch (std::exception&) {
72 ALOG(
"error loading currency config for name " <<
name <<
" iso code " << isoCode);
84 doc, ccyNode,
"MinorUnitCodes",
85 std::vector<std::string>(ccy.minorUnitCodes().begin(), ccy.minorUnitCodes().end()));
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
vector< ConfigurableCurrency > currencies_
Small XML Document wrapper class.
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
static void addGenericChildAsList(XMLDocument &doc, XMLNode *n, const string &name, const vector< T > &values, const string &attrName="", const string &attr="")
static void checkNode(XMLNode *n, const string &expectedName)
static vector< XMLNode * > getChildrenNodes(XMLNode *node, const string &name)
Returns all the children with a given name.
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
currency parser singleton class
QuantExt::ConfigurableCurrency::Type parseCurrencyType(const string &s)
Convert text to QuantExt::ConfigurableCurrency::Type (Major, Minor, Metal, Crypto)
QuantLib::Rounding::Type parseRoundingType(const std::string &s)
Convert text to QuantLib::Rounding.
Integer parseInteger(const string &s)
Convert text to QuantLib::Integer.
#define DLOG(text)
Logging Macro (Level = Debug)
#define ALOG(text)
Logging Macro (Level = Alert)
std::vector< string > parseListOfValues(string s, const char escape, const char delim, const char quote)
std::string to_string(const LocationInfo &l)
Serializable Credit Default Swap.
Map text representations to QuantLib/QuantExt types.
string conversion utilities