diff tools/mkunicode/Unicode-after.cpp @ 395:b78d6d8f2872

Unicode: remove class, use namespace
author David Demelier <markand@malikania.fr>
date Mon, 28 Sep 2015 15:55:46 +0200
parents 7fe8d4094983
children f083259de5e6
line wrap: on
line diff
--- a/tools/mkunicode/Unicode-after.cpp	Mon Sep 28 15:45:35 2015 +0200
+++ b/tools/mkunicode/Unicode-after.cpp	Mon Sep 28 15:55:46 2015 +0200
@@ -1,4 +1,4 @@
-void Unicode::encode(char32_t c, char res[5]) noexcept
+void encode(char32_t c, char res[5]) noexcept
 {
 	switch (nbytesPoint(c)) {
 	case 1:
@@ -28,7 +28,7 @@
 	}
 }
 
-void Unicode::decode(char32_t &c, const char *res) noexcept
+void decode(char32_t &c, const char *res) noexcept
 {
 	c = 0;
 
@@ -55,7 +55,7 @@
 	}
 }
 
-int Unicode::nbytesUtf8(char c) noexcept
+int nbytesUtf8(char c) noexcept
 {
 	if ((c & 0xE0) == 0xC0)
 		return 2;
@@ -67,7 +67,7 @@
 	return 1;
 }
 
-int Unicode::nbytesPoint(char32_t c) noexcept
+int nbytesPoint(char32_t c) noexcept
 {
 	if (c <= 0x7F)
 		return 1;
@@ -81,7 +81,7 @@
 	return -1;
 }
 
-int Unicode::length(const std::string &str)
+int length(const std::string &str)
 {
 	int total = 0;
 
@@ -92,7 +92,7 @@
 	return total;
 }
 
-std::string Unicode::toUtf8(const std::u32string &array)
+std::string toUtf8(const std::u32string &array)
 {
 	std::string res;
 
@@ -111,7 +111,7 @@
 	return res;
 }
 
-std::u32string Unicode::toUtf32(const std::string &str)
+std::u32string toUtf32(const std::string &str)
 {
 	std::u32string res;
 
@@ -120,4 +120,6 @@
 	});
 
 	return res;
-}
\ No newline at end of file
+}
+
+} // !unicode