Skip to content

Commit aa875b5

Browse files
damienbarkerjenkins
authored andcommitted
Merge remote-tracking branch 'origin/1.0.69' into 1.0.69_to_master
1 parent 78d1a04 commit aa875b5

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

OREAnalytics/orea/simm/crifloader.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,19 @@ bool CrifLoader::process(const vector<string>& entries, Size maxIndex, Size curr
443443
// a qualifier in a minor ccy?
444444
if (!checkCurrency(cr.qualifier) && checkCurrency(ccyUpper))
445445
cr.qualifier = ccyUpper;
446-
} else if (cr.riskType == RiskType::FXVol && cr.qualifier.size() == 6) {
446+
} else if (cr.riskType == RiskType::FXVol && (cr.qualifier.size() == 6 || cr.qualifier.size() == 7)) {
447+
448+
// Remove delimiters between the two currencies
449+
if (cr.qualifier.size() == 7) {
450+
vector<string> tokens;
451+
tokens = boost::split(tokens, cr.qualifier, boost::is_any_of("/.,-_|;: "));
452+
QL_REQUIRE(tokens.size() == 2, "Failed to parse Risk_FXVol qualifier (" << cr.qualifier << ").");
453+
string ccy1 = tokens[0];
454+
string ccy2 = tokens[1];
455+
cr.qualifier = ccy1 + ccy2;
456+
}
457+
458+
// Convert to uppercase
447459
string ccyPairUpper = boost::to_upper_copy(cr.qualifier);
448460
string ccy1Upper = ccyPairUpper.substr(0, 3);
449461
string ccy2Upper = ccyPairUpper.substr(3);

0 commit comments

Comments
 (0)