mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2554 Non-Darcy : Add tool for text compare
This commit is contained in:
parent
801b1aefb8
commit
3a1147dcdf
@ -19,6 +19,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAnalyzer.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSimWellBranchTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileVersionTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaTextStringTools.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -41,6 +42,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAnalyzer.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaSimWellBranchTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileVersionTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RiaTextStringTools.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
41
ApplicationCode/Application/Tools/RiaTextStringTools.cpp
Normal file
41
ApplicationCode/Application/Tools/RiaTextStringTools.cpp
Normal file
@ -0,0 +1,41 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 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 "RiaTextStringTools.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaTextStringTools::compare(const QString& expected, const QString& actual)
|
||||
{
|
||||
// Suggestions for improvement
|
||||
// 1. report line number for first change
|
||||
// 2. report line numbers for all changes
|
||||
// 3. add support for compare with content of a text file on disk
|
||||
|
||||
if (expected.compare(actual) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
29
ApplicationCode/Application/Tools/RiaTextStringTools.h
Normal file
29
ApplicationCode/Application/Tools/RiaTextStringTools.h
Normal file
@ -0,0 +1,29 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 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
|
||||
|
||||
class QString;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
namespace RiaTextStringTools
|
||||
{
|
||||
bool compare(const QString& expected, const QString& actual);
|
||||
}
|
Loading…
Reference in New Issue
Block a user