3 //=========================================================================
5 * @file Encoding_Converter.h
7 * This class is the base class for all encoding converters that convert
10 * @author Chad Elliott <elliott_c@ociweb.com>
12 //=========================================================================
14 #ifndef ACE_ENCODING_CONVERTER_H
15 #define ACE_ENCODING_CONVERTER_H
17 #include /**/ "ace/pre.h"
19 #include "ace/Basic_Types.h"
21 #if defined (ACE_USES_WCHAR)
22 #include /**/ "ace/ACE_export.h"
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
26 /** The base class for all ACE UTF Encoding Converters.
27 * This class provides a generic interface that is used to implement
28 * various UTF encoding conversion classes.
30 class ACE_Export ACE_Encoding_Converter
33 /// This enum describes the various states that can be returned
34 /// from the to_utf8() and from_utf8() methods which depends on
35 /// both the source buffer and the size of the target buffer.
36 enum Result
{CONVERSION_OK
,
42 /// This destructor is here (and virtual) because we have virtual
44 virtual ~ACE_Encoding_Converter ();
46 /// Convert the source (which can be in any encoding) to UTF-8 and
47 /// store it in the provided target buffer.
48 virtual Result
to_utf8 (const void* source
,
52 bool strict
= true) = 0;
54 /// Convert the UTF-8 source into an alternate encoding and store it
55 /// in the provided target buffer.
56 virtual Result
from_utf8 (const ACE_Byte
* source
,
60 bool strict
= true) = 0;
63 ACE_END_VERSIONED_NAMESPACE_DECL
64 #endif /* ACE_USES_WCHAR */
66 #include /**/ "ace/post.h"
68 #endif /* ACE_ENCODING_CONVERTER_H */