mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #8159 from OPM/performance-surface
Performance Surface import and resampling
This commit is contained in:
@@ -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() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user