#3152 Observed data import. Allow only vector names with certain lenghts to be put in a standard category

This commit is contained in:
Bjørn Erik Jensen 2018-07-09 10:06:30 +02:00
parent 93af11f934
commit 3bc595dcb2

View File

@ -281,7 +281,9 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromEclipseTextAddress(const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RifEclipseSummaryAddress::SummaryVarCategory RifEclipseSummaryAddress::identifyCategory(const std::string& quantityName) RifEclipseSummaryAddress::SummaryVarCategory RifEclipseSummaryAddress::identifyCategory(const std::string& quantityName)
{ {
if (quantityName.size() == 0) return RifEclipseSummaryAddress::SUMMARY_INVALID; if (quantityName.size() < 3 ||
quantityName.size() > 8 ||
(quantityName.size() > 5 && quantityName.size() < 8)) return RifEclipseSummaryAddress::SUMMARY_INVALID;
QRegExp regexp("^[A-Za-z0-9_\\-]*$"); QRegExp regexp("^[A-Za-z0-9_\\-]*$");
if(!regexp.exactMatch(QString::fromStdString(quantityName))) return RifEclipseSummaryAddress::SUMMARY_INVALID; if(!regexp.exactMatch(QString::fromStdString(quantityName))) return RifEclipseSummaryAddress::SUMMARY_INVALID;