changed: use internal trim methods instead of boost

This commit is contained in:
Arne Morten Kvarving
2020-02-18 14:31:03 +01:00
parent ec1dabf80e
commit c8458049e8
4 changed files with 9 additions and 13 deletions

View File

@@ -20,8 +20,7 @@
#include <opm/parser/eclipse/Deck/DeckOutput.hpp>
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
#include <opm/parser/eclipse/Units/Dimension.hpp>
#include <boost/algorithm/string.hpp>
#include <opm/parser/eclipse/Utility/String.hpp>
#include <algorithm>
#include <string>
@@ -261,9 +260,7 @@ void DeckItem::push_backDummyDefault() {
}
std::string DeckItem::getTrimmedString( size_t index ) const {
return boost::algorithm::trim_copy(
this->value_ref< std::string >().at( index )
);
return trim_copy(this->value_ref< std::string >().at(index));
}
double DeckItem::getSIDouble( size_t index ) const {

View File

@@ -17,8 +17,10 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <boost/algorithm/string.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/PinchMode.hpp>
#include <opm/parser/eclipse/Utility/String.hpp>
#include <stdexcept>
namespace Opm {
@@ -44,8 +46,7 @@ namespace Opm {
}
ModeEnum PinchModeFromString(const std::string& stringValue) {
std::string s(stringValue);
boost::algorithm::trim(s);
std::string s = trim_copy(stringValue);
ModeEnum mode;
if (s == "ALL") { mode = ModeEnum::ALL; }

View File

@@ -17,7 +17,6 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdexcept>
#include <boost/algorithm/string.hpp>
#include <opm/parser/eclipse/Parser/ParserKeyword.hpp>
#include <opm/parser/eclipse/Utility/String.hpp>
@@ -31,7 +30,7 @@ namespace Opm {
namespace {
std::string keyword_name(const std::string& input_name) {
std::string name = boost::algorithm::trim_right_copy(input_name);
std::string name = rtrim_copy(input_name);
if (!ParserKeyword::validDeckName(name))
throw std::invalid_argument("Not a valid keyword:" + name);

View File

@@ -17,7 +17,6 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdexcept>
#include <boost/algorithm/string.hpp>
#include <opm/parser/eclipse/Parser/ParserKeyword.hpp>
#include <opm/parser/eclipse/RawDeck/RawConsts.hpp>
@@ -153,12 +152,12 @@ namespace Opm {
}
void RawKeyword::setKeywordName(const std::string& name) {
m_name = boost::algorithm::trim_right_copy(name);
m_name = rtrim_copy(name);
if (!isValidKeyword(m_name)) {
throw std::invalid_argument("Not a valid keyword:" + name);
} else if (m_name.size() > Opm::RawConsts::maxKeywordLength) {
throw std::invalid_argument("Too long keyword:" + name);
} else if (boost::algorithm::trim_left_copy(m_name) != m_name) {
} else if (ltrim_copy(m_name) != m_name) {
throw std::invalid_argument("Illegal whitespace start of keyword:" + name);
}
}