utf8 for logdir and datadir xml stream
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// C++ Implementation: qthelper
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
|
||||
//
|
||||
// Copyright: See COPYING file that comes with this distribution
|
||||
//
|
||||
//
|
||||
#include "qthelper.h"
|
||||
|
||||
QtHelper::QtHelper()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
QtHelper::~QtHelper()
|
||||
{
|
||||
}
|
||||
|
||||
std::string QtHelper::stringToUtf8(const std::string &myString) {
|
||||
|
||||
QString tmpString = QString::fromStdString(myString);
|
||||
std::string myUtf8String = tmpString.toUtf8().constData();
|
||||
|
||||
return myUtf8String;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// C++ Interface: qthelper
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// Author: FThauer FHammer <webmaster@pokerth.net>, (C) 2007
|
||||
//
|
||||
// Copyright: See COPYING file that comes with this distribution
|
||||
//
|
||||
//
|
||||
#ifndef QTHELPER_H
|
||||
#define QTHELPER_H
|
||||
|
||||
#include <QtCore>
|
||||
/**
|
||||
@author FThauer FHammer <webmaster@pokerth.net>
|
||||
*/
|
||||
class QtHelper{
|
||||
public:
|
||||
QtHelper();
|
||||
|
||||
~QtHelper();
|
||||
|
||||
std::string stringToUtf8(const std::string &);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -20,21 +20,21 @@
|
||||
|
||||
#include "qttoolswrapper.h"
|
||||
|
||||
#include <appdirpath.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
QtToolsWrapper::QtToolsWrapper() : myAppDirPath(0)
|
||||
QtToolsWrapper::QtToolsWrapper() : myQtHelper(0)
|
||||
{
|
||||
|
||||
myAppDirPath = new AppDirPath();
|
||||
myQtHelper = new QtHelper();
|
||||
}
|
||||
|
||||
|
||||
QtToolsWrapper::~QtToolsWrapper()
|
||||
{
|
||||
delete myQtHelper;
|
||||
myQtHelper = 0;
|
||||
}
|
||||
|
||||
std::string QtToolsWrapper::getMyAppDirPath() const { return myAppDirPath->getMyPath(); }
|
||||
std::string QtToolsWrapper::stringToUtf8(const std::string &myString) { return myQtHelper->stringToUtf8(myString); }
|
||||
|
||||
|
||||
@@ -21,11 +21,12 @@
|
||||
#define QTTOOLSWRAPPER_H
|
||||
|
||||
#include <qttoolsinterface.h>
|
||||
#include <qthelper.h>
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
class AppDirPath;
|
||||
class QtHelper;
|
||||
|
||||
class QtToolsWrapper : public QtToolsInterface
|
||||
{
|
||||
@@ -34,11 +35,11 @@ public:
|
||||
|
||||
~QtToolsWrapper();
|
||||
|
||||
std::string getMyAppDirPath() const;
|
||||
std::string stringToUtf8(const std::string &myString);
|
||||
|
||||
private:
|
||||
|
||||
AppDirPath *myAppDirPath;
|
||||
QtHelper *myQtHelper;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user