aboutsummaryrefslogtreecommitdiff
path: root/libs/usvfs/src/usvfs_dll/stringcast_boost.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/usvfs/src/usvfs_dll/stringcast_boost.h')
-rw-r--r--libs/usvfs/src/usvfs_dll/stringcast_boost.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/libs/usvfs/src/usvfs_dll/stringcast_boost.h b/libs/usvfs/src/usvfs_dll/stringcast_boost.h
new file mode 100644
index 0000000..d2544ec
--- /dev/null
+++ b/libs/usvfs/src/usvfs_dll/stringcast_boost.h
@@ -0,0 +1,42 @@
+/*
+Userspace Virtual Filesystem
+
+Copyright (C) 2015 Sebastian Herbord. All rights reserved.
+
+This file is part of usvfs.
+
+usvfs is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+usvfs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with usvfs. If not, see <http://www.gnu.org/licenses/>.
+*/
+#include <stringcast.h>
+
+namespace usvfs
+{
+namespace shared
+{
+
+ template <typename ToT, typename CharT, typename Traits, typename Allocator>
+ class string_cast_impl<ToT, boost::container::basic_string<CharT, Traits, Allocator>>
+ {
+ public:
+ static ToT
+ cast(const boost::container::basic_string<CharT, Traits, Allocator>& source,
+ CodePage codePage, size_t sourceLength)
+ {
+ return string_cast_impl<ToT, const CharT*>::cast(source.c_str(), codePage,
+ sourceLength);
+ }
+ };
+
+} // namespace shared
+} // namespace usvfs