mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4683 clang-format on all files in ApplicationCode
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -30,39 +30,38 @@
|
||||
class RiaStdStringTools
|
||||
{
|
||||
public:
|
||||
static std::string trimString(const std::string& s);
|
||||
static bool isNumber(const std::string& s, char decimalPoint);
|
||||
static std::string trimString( const std::string& s );
|
||||
static bool isNumber( const std::string& s, char decimalPoint );
|
||||
|
||||
static int16_t toInt16(const std::string& s);
|
||||
static int toInt(const std::string& s);
|
||||
static double toDouble(const std::string& s);
|
||||
static bool containsAlphabetic(const std::string& s);
|
||||
static bool startsWithAlphabetic(const std::string& s);
|
||||
static int16_t toInt16( const std::string& s );
|
||||
static int toInt( const std::string& s );
|
||||
static double toDouble( const std::string& s );
|
||||
static bool containsAlphabetic( const std::string& s );
|
||||
static bool startsWithAlphabetic( const std::string& s );
|
||||
|
||||
static bool endsWith(const std::string& mainStr, const std::string& toMatch);
|
||||
static bool endsWith( const std::string& mainStr, const std::string& toMatch );
|
||||
|
||||
|
||||
static std::vector<std::string> splitStringBySpace(const std::string& s);
|
||||
static std::vector<std::string> splitStringBySpace( const std::string& s );
|
||||
|
||||
private:
|
||||
template <class Container>
|
||||
static void splitByDelimiter(const std::string& str, Container& cont, char delimiter = ' ');
|
||||
static size_t findCharMatchCount(const std::string& s, char c);
|
||||
static void splitByDelimiter( const std::string& str, Container& cont, char delimiter = ' ' );
|
||||
static size_t findCharMatchCount( const std::string& s, char c );
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
template <class Container>
|
||||
void RiaStdStringTools::splitByDelimiter(const std::string& str, Container& cont, char delimiter)
|
||||
void RiaStdStringTools::splitByDelimiter( const std::string& str, Container& cont, char delimiter )
|
||||
{
|
||||
std::stringstream ss(str);
|
||||
std::string token;
|
||||
while (std::getline(ss, token, delimiter))
|
||||
std::stringstream ss( str );
|
||||
std::string token;
|
||||
while ( std::getline( ss, token, delimiter ) )
|
||||
{
|
||||
if (token.find_first_not_of(delimiter) != std::string::npos)
|
||||
if ( token.find_first_not_of( delimiter ) != std::string::npos )
|
||||
{
|
||||
cont.push_back(token);
|
||||
cont.push_back( token );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user