Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Namespaces | Typedefs | Functions
parsers.cpp File Reference
#include <boost/algorithm/string.hpp>
#include <map>
#include <ored/utilities/calendarparser.hpp>
#include <ored/utilities/currencyparser.hpp>
#include <ored/utilities/indexparser.hpp>
#include <ored/utilities/parsers.hpp>
#include <ored/utilities/to_string.hpp>
#include <ql/errors.hpp>
#include <ql/indexes/all.hpp>
#include <ql/time/daycounters/all.hpp>
#include <ql/utilities/dataparsers.hpp>
#include <qle/instruments/cashflowresults.hpp>
#include <qle/time/yearcounter.hpp>
#include <boost/lexical_cast.hpp>
#include <regex>

Go to the source code of this file.

Namespaces

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

Typedefs

using ADCP = CommodityFutureConvention::AveragingData::CalculationPeriod
 
using PST = PriceSegment::Type
 
using CQF = CommodityQuantityFrequency
 

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...
 
QuantLib::Bond::Price::Type parseBondPriceType (const string &s)
 Convert text to QuantLib::Bond::Price::Type. 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...
 
boost::variant< QuantLib::Date, QuantLib::Period > parseDateOrPeriod (const string &s)
 Convert text to QuantLib::Period or QuantLib::Date. More...
 
void parseDateOrPeriod (const string &s, Date &d, Period &p, bool &isDate)
 
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...
 
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...
 
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...
 
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...
 
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...
 
ostream & operator<< (ostream &os, Rounding::Type t)
 
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, SabrParametricVolatility::ModelVariant m)
 
std::ostream & operator<< (std::ostream &os, Exercise::Type type)
 

Variable Documentation

◆ res_d

Date& res_d

Definition at line 516 of file parsers.cpp.

◆ res_p

Period& res_p

Definition at line 517 of file parsers.cpp.

◆ res_is_date

bool& res_is_date

Definition at line 518 of file parsers.cpp.