aboutsummaryrefslogtreecommitdiff
path: root/externals/ace/UTF32_Encoding_Converter.h
diff options
context:
space:
mode:
authorXanadu <none@none>2010-07-20 02:49:28 +0200
committerXanadu <none@none>2010-07-20 02:49:28 +0200
commit79622802f397258ee0f34327ba3ae6977ca3e7ff (patch)
tree1868946c234ab9ee256a6b7766a15713eae94235 /externals/ace/UTF32_Encoding_Converter.h
parent7dd2dc91816ab8b3bc3b99a1b1c99c7ea314d5a8 (diff)
parentf906976837502fa5aa81b982b901d1509f5aa0c4 (diff)
Merge. Revision history for source files should be all back now.
--HG-- branch : trunk rename : sql/CMakeLists.txt => sql/tools/CMakeLists.txt rename : src/server/game/Pools/PoolHandler.cpp => src/server/game/Pools/PoolMgr.cpp rename : src/server/game/Pools/PoolHandler.h => src/server/game/Pools/PoolMgr.h rename : src/server/game/PrecompiledHeaders/NixCorePCH.cpp => src/server/game/PrecompiledHeaders/gamePCH.cpp rename : src/server/game/PrecompiledHeaders/NixCorePCH.h => src/server/game/PrecompiledHeaders/gamePCH.h
Diffstat (limited to 'externals/ace/UTF32_Encoding_Converter.h')
-rw-r--r--externals/ace/UTF32_Encoding_Converter.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/externals/ace/UTF32_Encoding_Converter.h b/externals/ace/UTF32_Encoding_Converter.h
new file mode 100644
index 00000000000..214edeeeed8
--- /dev/null
+++ b/externals/ace/UTF32_Encoding_Converter.h
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+
+//=========================================================================
+/**
+ * @file UTF32_Encoding_Converter.h
+ *
+ * $Id: UTF32_Encoding_Converter.h 80826 2008-03-04 14:51:23Z wotte $
+ *
+ * This class contains declarations for methods that convert between
+ * UTF-32 (both BE and LE) and UTF-8
+ *
+ * @author Chad Elliott <elliott_c@ociweb.com>
+ */
+//=========================================================================
+
+#ifndef ACE_UTF32_ENCODING_CONVERTER_H
+#define ACE_UTF32_ENCODING_CONVERTER_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/UTF16_Encoding_Converter.h"
+
+#if defined (ACE_USES_WCHAR)
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/** Convert from UTF-32 to UTF-8 and from UTF-8 to UTF-32.
+ * This class implements the ACE_Encoding_Converter interface.
+ */
+class ACE_UTF32_Encoding_Converter: public ACE_UTF16_Encoding_Converter
+{
+public:
+ /// This class has some similarities to the UTF16 converter, so
+ /// we just construct our base class and pass the swap parameter.
+ ACE_UTF32_Encoding_Converter (bool swap = false);
+
+ /// This is a do nothing destructor.
+ virtual ~ACE_UTF32_Encoding_Converter (void);
+
+ /// Convert the source from UTF-32 to UTF-8 and store it in the
+ /// provided target buffer.
+ virtual Result to_utf8 (const void* source,
+ size_t source_size,
+ ACE_Byte* target,
+ size_t target_size,
+ bool strict = true);
+
+ /// Convert the UTF-8 source into a UTF-32 encoding and store it
+ /// in the provided target buffer.
+ virtual Result from_utf8 (const ACE_Byte* source,
+ size_t source_size,
+ void* target,
+ size_t target_size,
+ bool strict = true);
+
+ /// This factory helper method determines if the source stream is UTF-32
+ /// encoded. If it is, allocate an ACE_UTF32_Encoding_Converter and
+ /// return it. The caller then owns the allocated object.
+ static ACE_UTF32_Encoding_Converter* encoded (const ACE_Byte* source,
+ size_t source_size);
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+#endif /* ACE_USES_WCHAR */
+
+#include /**/ "ace/post.h"
+
+#endif /* ACE_UTF32_ENCODING_CONVERTER_H */