mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add separate scriptKeyword to RICF capability and a Python help tooltip system
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "RiaTextStringTools.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
#include <QString>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -54,3 +55,17 @@ QString RiaTextStringTools::trimAndRemoveDoubleSpaces( const QString& s )
|
||||
|
||||
return trimmed;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaTextStringTools::camelToSnakeCase( const QString& camelString )
|
||||
{
|
||||
static QRegularExpression re1( "(.)([A-Z][a-z]+)" );
|
||||
static QRegularExpression re2( "([a-z0-9])([A-Z])" );
|
||||
|
||||
QString snake_case = camelString;
|
||||
snake_case.replace( re1, "\\1_\\2" );
|
||||
snake_case.replace( re2, "\\1_\\2" );
|
||||
return snake_case.toLower();
|
||||
}
|
||||
|
||||
@@ -27,4 +27,5 @@ namespace RiaTextStringTools
|
||||
{
|
||||
bool compare( const QString& expected, const QString& actual );
|
||||
QString trimAndRemoveDoubleSpaces( const QString& s );
|
||||
QString camelToSnakeCase( const QString& camelString );
|
||||
} // namespace RiaTextStringTools
|
||||
|
||||
Reference in New Issue
Block a user