#2086 Moved RifStringTools -> RiaStringEncodingTools

This commit is contained in:
Bjørn Erik Jensen
2018-02-02 15:44:28 +01:00
parent d5116d8942
commit 98a94c0525
12 changed files with 43 additions and 43 deletions

View File

@@ -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

View 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
}

View 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);
};