Merge pull request #8159 from OPM/performance-surface

Performance Surface import and resampling
This commit is contained in:
Magne Sjaastad
2021-10-15 16:55:58 +02:00
committed by GitHub
parent 6b3ad20587
commit afadaf27d5
6 changed files with 113 additions and 58 deletions

View File

@@ -18,7 +18,10 @@
#include "RiaStdStringTools.h"
#include "fast_float/include/fast_float/fast_float.h"
#include <cctype>
#include <charconv>
//--------------------------------------------------------------------------------------------------
///
@@ -107,6 +110,26 @@ bool RiaStdStringTools::startsWithAlphabetic( const std::string& s )
return isalpha( s[0] ) != 0;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaStdStringTools::toDouble( const std::string_view& s, double& value )
{
auto resultObject = fast_float::from_chars( s.data(), s.data() + s.size(), value );
return ( resultObject.ec == std::errc() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaStdStringTools::toInt( const std::string_view& s, int& value )
{
auto resultObject = std::from_chars( s.data(), s.data() + s.size(), value );
return ( resultObject.ec == std::errc() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------