summaryrefslogtreecommitdiffstats
path: root/src/Core/String.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core/String.cpp')
-rw-r--r--src/Core/String.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Core/String.cpp b/src/Core/String.cpp
index d9d357e..e66e456 100644
--- a/src/Core/String.cpp
+++ b/src/Core/String.cpp
@@ -22,6 +22,15 @@
namespace Mad {
namespace Core {
+std::string String::toCodepage(const char *codepage) const {
+ boost::uint32_t len = static_cast<boost::uint32_t>(extract(0, length(), 0, codepage));
+
+ boost::scoped_array<char> buf(new char[len]);
+ extract(0, length(), buf.get(), len, codepage);
+
+ return std::string(buf.get(), len);
+}
+
boost::int32_t String::findFirstOf(const String &chars, boost::int32_t start) const {
for(boost::int32_t i = start; i < length(); ++i) {
if(chars.indexOf(charAt(i)) >= 0)