mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-20 11:48:35 -06:00
#2003 Observed Data : Add RiaStdStringTools
This commit is contained in:
parent
bf8e4ed4ed
commit
3fa48d175f
@ -19,6 +19,7 @@ ${CEE_CURRENT_LIST_DIR}RiaImportEclipseCaseTools.h
|
||||
${CEE_CURRENT_LIST_DIR}RiaQDateTimeTools.h
|
||||
${CEE_CURRENT_LIST_DIR}RiaSummaryTools.h
|
||||
${CEE_CURRENT_LIST_DIR}RiaWellNameComparer.h
|
||||
${CEE_CURRENT_LIST_DIR}RiaStdStringTools.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -35,6 +36,7 @@ ${CEE_CURRENT_LIST_DIR}RiaImportEclipseCaseTools.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiaQDateTimeTools.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiaSummaryTools.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiaWellNameComparer.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiaStdStringTools.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
30
ApplicationCode/Application/Tools/RiaStdStringTools.cpp
Normal file
30
ApplicationCode/Application/Tools/RiaStdStringTools.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaStdStringTools.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RiaStdStringTools::trimString(const std::string& s)
|
||||
{
|
||||
auto sCopy = s.substr(0, s.find_last_not_of(' ') + 1);
|
||||
sCopy = sCopy.substr(sCopy.find_first_not_of(' '));
|
||||
|
||||
return sCopy;
|
||||
}
|
31
ApplicationCode/Application/Tools/RiaStdStringTools.h
Normal file
31
ApplicationCode/Application/Tools/RiaStdStringTools.h
Normal file
@ -0,0 +1,31 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiaStdStringTools
|
||||
{
|
||||
public:
|
||||
static std::string trimString(const std::string& s);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user