Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Namespaces | Enumerations | Functions
parsers.hpp File Reference

Map text representations to QuantLib/QuantExt types. More...

#include <ored/configuration/commoditycurveconfig.hpp>
#include <ored/configuration/conventions.hpp>
#include <ored/portfolio/types.hpp>
#include <ored/utilities/log.hpp>
#include <qle/cashflows/commoditycashflow.hpp>
#include <qle/currencies/configurablecurrency.hpp>
#include <qle/indexes/bondindex.hpp>
#include <qle/instruments/cdsoption.hpp>
#include <qle/methods/multipathgeneratorbase.hpp>
#include <qle/models/crossassetmodel.hpp>
#include <qle/pricingengines/mcmultilegbaseengine.hpp>
#include <qle/termstructures/sabrparametricvolatility.hpp>
#include <ql/cashflows/cpicoupon.hpp>
#include <ql/compounding.hpp>
#include <ql/currency.hpp>
#include <ql/exercise.hpp>
#include <ql/instruments/doublebarriertype.hpp>
#include <ql/experimental/fx/deltavolquote.hpp>
#include <ql/instruments/averagetype.hpp>
#include <ql/instruments/barriertype.hpp>
#include <ql/instruments/bond.hpp>
#include <ql/instruments/capfloor.hpp>
#include <ql/instruments/inflationcapfloor.hpp>
#include <ql/instruments/overnightindexfuture.hpp>
#include <ql/instruments/swaption.hpp>
#include <ql/methods/finitedifferences/solvers/fdmbackwardsolver.hpp>
#include <ql/methods/montecarlo/lsmbasissystem.hpp>
#include <ql/position.hpp>
#include <ql/termstructures/bootstraphelper.hpp>
#include <ql/time/businessdayconvention.hpp>
#include <ql/time/calendar.hpp>
#include <ql/time/date.hpp>
#include <ql/time/dategenerationrule.hpp>
#include <ql/time/daycounter.hpp>
#include <ql/time/period.hpp>
#include <ql/types.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/tokenizer.hpp>
#include <boost/variant.hpp>

Go to the source code of this file.

Namespaces

namespace  ore
 Serializable Credit Default Swap.
 
namespace  ore::data
 

Enumerations

enum class  AmortizationType {
  None , FixedAmount , RelativeToInitialNotional , RelativeToPreviousNotional ,
  Annuity , LinearToMaturity
}
 
enum class  AssetClass {
  EQ , FX , COM , IR ,
  INF , CR , BOND , BOND_INDEX
}
 
enum class  Extrapolation { None , UseInterpolator , Flat }
 Enumeration for holding various extrapolation settings. More...
 
enum class  MomentType { Variance , Volatility }
 
enum class  CreditPortfolioSensitivityDecomposition { Underlying , NotionalWeighted , LossWeighted , DeltaWeighted }
 Enumeration CreditPortfolioSensitivityDecomposition. More...
 
enum  MporCashFlowMode {
  Unspecified , NonePay , BothPay , WePay ,
  TheyPay
}
 

Functions

Date parseDate (const string &s)
 Convert std::string to QuantLib::Date. More...
 
Real parseReal (const string &s)
 Convert text to Real. More...
 
Real parseRealOrNull (const string &s)
 Convert text to Real, empty string to Null<Real>() More...
 
bool tryParseReal (const string &s, QuantLib::Real &result)
 Attempt to convert text to Real. More...
 
Integer parseInteger (const string &s)
 Convert text to QuantLib::Integer. More...
 
bool parseBool (const string &s)
 Convert text to bool. More...
 
Calendar parseCalendar (const string &s)
 Convert text to QuantLib::Calendar. More...
 
bool isOnePeriod (const string &s)
 return true if s represents a period of the form [0-9][D|W|M|Y] (i.e. 1Y6M would return false) More...
 
Period parsePeriod (const string &s)
 Convert text to QuantLib::Period. More...
 
BusinessDayConvention parseBusinessDayConvention (const string &s)
 Convert text to QuantLib::BusinessDayConvention. More...
 
DayCounter parseDayCounter (const string &s)
 Convert text to QuantLib::DayCounter. More...
 
Currency parseCurrency (const string &s)
 Convert text to QuantLib::Currency. More...
 
QuantExt::ConfigurableCurrency::Type parseCurrencyType (const string &s)
 Convert text to QuantExt::ConfigurableCurrency::Type (Major, Minor, Metal, Crypto) More...
 
Currency parseMinorCurrency (const string &s)
 Convert text to QuantLib::Currency for minor currencies e.g GBp -> GBPCurrency() More...
 
Currency parseCurrencyWithMinors (const string &s)
 Convert text to QuantLib::Currency. More...
 
pair< Currency, Currency > parseCurrencyPair (const string &s, const string &delimiters)
 Convert text to std::pair<QuantLib::Currency, QuantLib::Currency> More...
 
bool checkCurrency (const string &code)
 check for vaid currency code, including minors and pseudo currencies More...
 
bool isPseudoCurrency (const string &code)
 check for pseudo currency = precious metal or crypto currency *‍/ More...
 
bool isPreciousMetal (const string &code)
 check for precious metal *‍/ More...
 
bool isCryptoCurrency (const string &code)
 check for crypto currency *‍/ More...
 
QuantLib::Real convertMinorToMajorCurrency (const std::string &s, QuantLib::Real value)
 Convert a value from a minor ccy to major. More...
 
DateGeneration::Rule parseDateGenerationRule (const string &s)
 Convert text to QuantLib::DateGeneration::Rule. More...
 
Frequency parseFrequency (const string &s)
 Convert text to QuantLib::Frequency. More...
 
Compounding parseCompounding (const string &s)
 Convert text to QuantLib::Compounding;. More...
 
Position::Type parsePositionType (const string &s)
 Convert text to QuantLib::Position::Type. More...
 
Protection::Side parseProtectionSide (const string &s)
 Convert text to QuantLib::Protection::Side. More...
 
Settlement::Type parseSettlementType (const string &s)
 Convert text to QuantLib::Settlement::Type. More...
 
Settlement::Method parseSettlementMethod (const string &s)
 Convert text to QuantLib::Settlement::Method. More...
 
Exercise::Type parseExerciseType (const string &s)
 Convert text to QuantLib::Exercise::Type. More...
 
Option::Type parseOptionType (const string &s)
 Convert text to QuantLib::Option::Type. More...
 
QuantLib::Bond::Price::Type parseBondPriceType (const string &s)
 Convert text to QuantLib::Bond::Price::Type. More...
 
boost::variant< QuantLib::Date, QuantLib::Period > parseDateOrPeriod (const string &s)
 Convert text to QuantLib::Period or QuantLib::Date. More...
 
void parseDateOrPeriod (const string &s, QuantLib::Date &d, QuantLib::Period &p, bool &isDate)
 Convert text to QuantLib::Period or QuantLib::Date (deprecated version) More...
 
QuantLib::LsmBasisSystem::PolynomialType parsePolynomType (const std::string &s)
 Convert text to QuantLib::LsmBasisSystem::PolynomialType. More...
 
std::ostream & operator<< (std::ostream &os, QuantLib::LsmBasisSystem::PolynomialType a)
 Write QuantLib::LsmBasisSystem::PolynomialType to stream. More...
 
SobolBrownianGenerator::Ordering parseSobolBrownianGeneratorOrdering (const std::string &s)
 Convert text to QuantLib::SobolBrownianGenerator::Ordering. More...
 
SobolRsg::DirectionIntegers parseSobolRsgDirectionIntegers (const std::string &s)
 Convert text to QuantLib::SobolRsg::DirectionIntegers. More...
 
Weekday parseWeekday (const string &s)
 
Month parseMonth (const string &s)
 
PaymentLag parsePaymentLag (const string &s)
 Convert text to PaymentLag. More...
 
template<class T >
std::vector< T > parseListOfValues (string s, std::function< T(string)> parser)
 Convert comma separated list of values to vector of values. More...
 
template<class T >
std::vector< T > parseVectorOfValues (std::vector< std::string > str, std::function< T(string)> parser)
 
std::vector< string > parseListOfValues (string s, const char escape, const char delim, const char quote)
 
AmortizationType parseAmortizationType (const std::string &s)
 
SequenceType parseSequenceType (const std::string &s)
 Convert string to sequence type. More...
 
QuantLib::CPI::InterpolationType parseObservationInterpolation (const std::string &s)
 Convert string to observation interpolation. More...
 
FdmSchemeDesc parseFdmSchemeDesc (const std::string &s)
 Convert string to fdm scheme desc. More...
 
AssetClass parseAssetClass (const std::string &s)
 Convert text to ore::data::AssetClass. More...
 
std::ostream & operator<< (std::ostream &os, AssetClass a)
 Write ore::data::AssetClass to stream. More...
 
DeltaVolQuote::AtmType parseAtmType (const std::string &s)
 Convert text to QuantLib::DeltaVolQuote::AtmType. More...
 
DeltaVolQuote::DeltaType parseDeltaType (const std::string &s)
 Convert text to QuantLib::DeltaVolQuote::DeltaType. More...
 
QuantLib::Rounding::Type parseRoundingType (const std::string &s)
 Convert text to QuantLib::Rounding. More...
 
Barrier::Type parseBarrierType (const string &s)
 Convert std::string to QuantLib::BarrierType. More...
 
DoubleBarrier::Type parseDoubleBarrierType (const string &s)
 Convert std::string to QuantLib::DoubleBarrierType. More...
 
template<class T >
bool tryParse (const std::string &str, T &obj, std::function< T(const std::string &)> parser)
 
bool tryParseCurrency (const std::string &str, Currency &obj)
 
Extrapolation parseExtrapolation (const string &s)
 Parse Extrapolation from string. More...
 
std::ostream & operator<< (std::ostream &os, Extrapolation extrap)
 Write Extrapolation, extrap, to stream. More...
 
VolatilityType parseVolatilityQuoteType (const string &s)
 
CapFloor::Type parseCapFloorType (const string &s)
 
YoYInflationCapFloor::Type parseYoYInflationCapFloorType (const string &s)
 
QuantExt::CrossAssetModel::AssetType parseCamAssetType (const string &s)
 
pair< string, string > parseBoostAny (const boost::any &anyType, Size precision)
 
QuantLib::RateAveraging::Type parseOvernightIndexFutureNettingType (const std::string &s)
 Convert text to QuantLib::RateAveraging::Type. More...
 
std::ostream & operator<< (std::ostream &os, QuantLib::RateAveraging::Type t)
 Write QuantLib::RateAveraging::Type to stream. More...
 
FutureConvention::DateGenerationRule parseFutureDateGenerationRule (const std::string &s)
 Convert text to FutureConvention::DateGeneration. More...
 
std::ostream & operator<< (std::ostream &os, FutureConvention::DateGenerationRule t)
 Write QuantLib::RateAveraging::Type to stream. More...
 
InflationSwapConvention::PublicationRoll parseInflationSwapPublicationRoll (const std::string &s)
 Convert text to InflationSwapConvention::PublicationRoll. More...
 
ostream & operator<< (std::ostream &os, InflationSwapConvention::PublicationRoll pr)
 Write InflationSwapConvention::PublicationRoll to stream. More...
 
std::ostream & operator<< (std::ostream &os, SobolBrownianGenerator::Ordering t)
 Write QuantLib::SobolBrownianGenerator::Ordering to stream. More...
 
std::ostream & operator<< (std::ostream &os, SobolRsg::DirectionIntegers t)
 Write QuantLib::SobolRsg::DirectionIntegers to stream. More...
 
std::ostream & operator<< (std::ostream &os, QuantExt::CrossAssetModel::Discretization type)
 Enum to string used in ScenarioGeneratorData's toXML. More...
 
ADCP parseAveragingDataPeriod (const std::string &s)
 Convert text to CommodityFutureConvention::AveragingData::CalculationPeriod. More...
 
ostream & operator<< (std::ostream &os, CommodityFutureConvention::AveragingData::CalculationPeriod cp)
 Write CommodityFutureConvention::AveragingData::CalculationPeriod to stream. More...
 
PriceSegment::Type parsePriceSegmentType (const std::string &s)
 Convert text to PriceSegment::Type. More...
 
ostream & operator<< (std::ostream &os, PriceSegment::Type pst)
 Write PriceSegment::Type to stream. More...
 
CommodityQuantityFrequency parseCommodityQuantityFrequency (const std::string &s)
 Convert text to QuantExt::CommodityQuantityFrequency. More...
 
ostream & operator<< (std::ostream &os, QuantExt::CommodityQuantityFrequency cqf)
 Write QuantExt::CommodityQuantityFrequency to stream. More...
 
CdsOption::StrikeType parseCdsOptionStrikeType (const string &s)
 
Average::Type parseAverageType (const std::string &s)
 
QuantExt::BondIndex::PriceQuoteMethod parsePriceQuoteMethod (const std::string &s)
 
std::ostream & operator<< (std::ostream &os, QuantExt::BondIndex::PriceQuoteMethod)
 Write PriceQuoteMethod to stream. More...
 
std::vector< std::string > getCorrelationTokens (const std::string &name)
 Helper function to get the two tokens in a correlation name Index2:Index1. More...
 
string fxDominance (const string &s1, const string &s2)
 Convert FX pair to market standard dominance. More...
 
string normaliseFxIndex (const std::string &indexName)
 Convert FX index name to market standard dominance. More...
 
MomentType parseMomentType (const std::string &s)
 Convert text to ore::data::MomentType. More...
 
CreditPortfolioSensitivityDecomposition parseCreditPortfolioSensitivityDecomposition (const std::string &s)
 Convert text to CreditPortfolioSensitivitiyDecomposition. More...
 
std::ostream & operator<< (std::ostream &os, const CreditPortfolioSensitivityDecomposition d)
 Output operator for CreditPortfolioSensitivityDecomposition. More...
 
QuantLib::Pillar::Choice parsePillarChoice (const std::string &s)
 Convert text to QuantLib::Pillar::Choice. More...
 
QuantExt::McMultiLegBaseEngine::RegressorModel parseRegressorModel (const std::string &s)
 Convert text to QuantExt::McMultiLegBaseEngine::RegressorModel. More...
 
MporCashFlowMode parseMporCashFlowMode (const std::string &s)
 Convert text to MporCashFlowMode. More...
 
std::ostream & operator<< (std::ostream &os, MporCashFlowMode t)
 Write MporCashFlowMode to stream. More...
 
SabrParametricVolatility::ModelVariant parseSabrParametricVolatilityModelVariant (const std::string &s)
 Parse SabrParametricVolatility::ModelVariant. More...
 
std::ostream & operator<< (std::ostream &out, QuantExt::SabrParametricVolatility::ModelVariant m)
 Write SabrParametricVolatility::ModelVariant. More...
 
std::ostream & operator<< (std::ostream &os, QuantLib::Exercise::Type type)
 Write QuantLib::Exercise::Type. More...
 

Detailed Description

Map text representations to QuantLib/QuantExt types.

Definition in file parsers.hpp.