mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2086 Moved RifStringTools -> RiaStringEncodingTools
This commit is contained in:
@@ -24,6 +24,7 @@ ${CEE_CURRENT_LIST_DIR}RiaStdStringTools.h
|
||||
${CEE_CURRENT_LIST_DIR}RiaSummaryCurveAnalyzer.h
|
||||
${CEE_CURRENT_LIST_DIR}RiaSimWellBranchTools.h
|
||||
${CEE_CURRENT_LIST_DIR}RiaProjectFileVersionTools.h
|
||||
${CEE_CURRENT_LIST_DIR}RiaStringEncodingTools.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@@ -45,6 +46,7 @@ ${CEE_CURRENT_LIST_DIR}RiaStdStringTools.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiaSummaryCurveAnalyzer.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiaSimWellBranchTools.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiaProjectFileVersionTools.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiaStringEncodingTools.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
43
ApplicationCode/Application/Tools/RiaStringEncodingTools.cpp
Normal file
43
ApplicationCode/Application/Tools/RiaStringEncodingTools.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2011- Statoil ASA
|
||||
// Copyright (C) 2013- Ceetron Solutions AS
|
||||
// Copyright (C) 2011-2012 Ceetron AS
|
||||
//
|
||||
// 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 "RiaStringEncodingTools.h"
|
||||
|
||||
|
||||
const std::string RiaStringEncodingTools::toNativeEncoded(const QString& qstring)
|
||||
{
|
||||
#ifdef WIN32
|
||||
return std::string(qstring.toLatin1().data());
|
||||
#else
|
||||
return std::string(qstring.toUtf8().data());
|
||||
#endif
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const QString RiaStringEncodingTools::fromNativeEncoded(const char* native)
|
||||
{
|
||||
#ifdef WIN32
|
||||
return QString::fromLatin1(native);
|
||||
#else
|
||||
return QString::fromUtf8(native);
|
||||
#endif
|
||||
}
|
||||
38
ApplicationCode/Application/Tools/RiaStringEncodingTools.h
Normal file
38
ApplicationCode/Application/Tools/RiaStringEncodingTools.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2011- Statoil ASA
|
||||
// Copyright (C) 2013- Ceetron Solutions AS
|
||||
// Copyright (C) 2011-2012 Ceetron AS
|
||||
//
|
||||
// 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 <QString>
|
||||
#include <QByteArray>
|
||||
#include <string>
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiaStringEncodingTools
|
||||
{
|
||||
public:
|
||||
static const std::string toNativeEncoded(const QString& qstring);
|
||||
|
||||
static const QString fromNativeEncoded(const char* native);
|
||||
};
|
||||
Reference in New Issue
Block a user