diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2012-08-29 14:34:39 +0200 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2012-08-29 14:35:11 +0200 |
commit | b06e620913f0f35947a889929d185afb1a72d011 (patch) | |
tree | f9cee9df30f1d5c5c02c14a4d36ed8009742e752 /src/window.cpp | |
parent | b1c301dc1ca62287180afc9d7fef7e548e120f1d (diff) |
more cleanup and grouping functions logically together
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/src/window.cpp b/src/window.cpp index 4f31b959..a379dbc7 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -29,6 +29,7 @@ #endif #include "error.h" +#include "utility/string.h" #include "window.h" using namespace NCurses; @@ -923,31 +924,6 @@ Window &Window::operator<<(size_t s) return *this; } -std::string ToString(const std::wstring &ws) -{ - std::string result; - char s[MB_CUR_MAX]; - for (size_t i = 0; i < ws.length(); ++i) - { - int n = wcrtomb(s, ws[i], 0); - if (n > 0) - result.append(s, n); - } - return result; -} - -std::wstring ToWString(const std::string &s) -{ - std::wstring result; - wchar_t *ws = new wchar_t[s.length()]; - const char *c_s = s.c_str(); - int n = mbsrtowcs(ws, &c_s, s.length(), 0); - if (n > 0) - result.append(ws, n); - delete [] ws; - return result; -} - size_t Window::Length(const std::wstring &ws) { # ifdef WIN32 |