Unicode logic fixes for AddEntries
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30683 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "wx/fileconf.h"
|
#include "wx/fileconf.h"
|
||||||
#include "wx/sstream.h"
|
#include "wx/sstream.h"
|
||||||
|
#include "wx/wfstream.h"
|
||||||
|
|
||||||
#include "wx/cppunit.h"
|
#include "wx/cppunit.h"
|
||||||
|
|
||||||
@@ -44,7 +45,9 @@ _T("[root/group2]\n")
|
|||||||
class FileConfigTestCase : public CppUnit::TestCase
|
class FileConfigTestCase : public CppUnit::TestCase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FileConfigTestCase() { }
|
FileConfigTestCase()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CPPUNIT_TEST_SUITE( FileConfigTestCase );
|
CPPUNIT_TEST_SUITE( FileConfigTestCase );
|
||||||
@@ -84,9 +87,23 @@ private:
|
|||||||
|
|
||||||
static wxString Dump(wxFileConfig& fc)
|
static wxString Dump(wxFileConfig& fc)
|
||||||
{
|
{
|
||||||
wxStringOutputStream sos;
|
wxFileOutputStream* pOutFile = new wxFileOutputStream(_T("outconf.txt"));
|
||||||
fc.Save(sos);
|
fc.Save(*pOutFile);
|
||||||
return wxTextFile::Translate(sos.GetString(), wxTextFileType_Unix);
|
delete pOutFile;
|
||||||
|
|
||||||
|
wxFileInputStream* pInFile = new wxFileInputStream(_T("outconf.txt"));
|
||||||
|
char* szOut = new char[pInFile->GetSize()];
|
||||||
|
pInFile->Read(szOut, pInFile->GetSize());
|
||||||
|
|
||||||
|
wxString realString = wxTextFile::Translate(
|
||||||
|
wxString(szOut, wxConvLocal, pInFile->GetSize()),
|
||||||
|
wxTextFileType_Unix
|
||||||
|
);
|
||||||
|
|
||||||
|
delete szOut;
|
||||||
|
delete pInFile;
|
||||||
|
|
||||||
|
return realString;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckGroupEntries(const wxFileConfig& fc,
|
void CheckGroupEntries(const wxFileConfig& fc,
|
||||||
|
Reference in New Issue
Block a user