diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-15 18:52:16 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-15 18:52:16 +0000 |
commit | 58973a21a30bf95427fd43c456e41e35c386218c (patch) | |
tree | 1413fba069ecd351b2c99fa5a53e52c68d8a662c /plugins/Boltun/Engine | |
parent | 55b5cf8a5506f03350e5c80ac86f5717425e4d10 (diff) |
another portion of "#ifsef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@434 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Boltun/Engine')
-rw-r--r-- | plugins/Boltun/Engine/Mind.cpp | 22 | ||||
-rw-r--r-- | plugins/Boltun/Engine/Mind.h | 3 | ||||
-rw-r--r-- | plugins/Boltun/Engine/MyCodeCvt.cpp | 4 |
3 files changed, 11 insertions, 18 deletions
diff --git a/plugins/Boltun/Engine/Mind.cpp b/plugins/Boltun/Engine/Mind.cpp index 667e1faf1a..fc4520de55 100644 --- a/plugins/Boltun/Engine/Mind.cpp +++ b/plugins/Boltun/Engine/Mind.cpp @@ -26,9 +26,7 @@ #include <windows.h>
-#ifdef UNICODE
#include "MyCodeCvt.h"
-#endif
using namespace std;
@@ -108,19 +106,19 @@ void Mind::Load(tstring filename) {
basic_ifstream<TCHAR, char_traits<TCHAR> > file;
setlocale(LC_ALL, "");
-#ifdef UNICODE
+
locale ulocale(locale(), new MyCodeCvt);
file.imbue(ulocale);
-#endif
+
file.open(filename.c_str(), ios_base::in | ios_base::binary);
tstring s1, st;
TCHAR *c, *co;
size_t count;
int error = 0;
int line = 1;
-#ifdef UNICODE
+
bool start = true;
-#endif
+
try
{
while (file.good())
@@ -129,7 +127,7 @@ void Mind::Load(tstring filename) if (st.empty())
break;
line++;
-#ifdef UNICODE
+
if (start)
{
if (st[0] == 65279)
@@ -141,7 +139,7 @@ void Mind::Load(tstring filename) fileTypeMark = false;
start = false;
}
-#endif
+
format(st);
count = st.length();
c = co = new TCHAR[count+1];
@@ -317,15 +315,15 @@ void Mind::Load(tstring filename) void Mind::Save(tstring filename) const
{
basic_ofstream<TCHAR, char_traits<TCHAR> > file;
-#ifdef UNICODE
+
locale ulocale(locale(), new MyCodeCvt);
file.imbue(ulocale);
-#endif
+
file.open(filename.c_str(), ios_base::out | ios_base::binary);
-#ifdef UNICODE
+
if (fileTypeMark)
file << TCHAR(65279);
-#endif
+
for (string_mmap::iterator it = data->study.begin(); it != data->study.end(); it++)
{
file << (*it).first << _T('\r') << endl;
diff --git a/plugins/Boltun/Engine/Mind.h b/plugins/Boltun/Engine/Mind.h index ecf3f5d199..23e0a41bd3 100644 --- a/plugins/Boltun/Engine/Mind.h +++ b/plugins/Boltun/Engine/Mind.h @@ -59,9 +59,8 @@ class Mind {
private:
MindData *data;
-#ifdef UNICODE
bool fileTypeMark;
-#endif
+
std::vector<tstring> Parse(tstring s);
public:
Mind();
diff --git a/plugins/Boltun/Engine/MyCodeCvt.cpp b/plugins/Boltun/Engine/MyCodeCvt.cpp index 49722e6f7b..5d7baf4d88 100644 --- a/plugins/Boltun/Engine/MyCodeCvt.cpp +++ b/plugins/Boltun/Engine/MyCodeCvt.cpp @@ -18,8 +18,6 @@ //
//***********************************************************
-#ifdef UNICODE
-
#include "MyCodeCvt.h"
using namespace std;
@@ -81,5 +79,3 @@ int MyCodeCvt::do_encoding() const _THROW0() {
return 2;
}
-
-#endif
\ No newline at end of file |