3 //=============================================================================
5 * @file UTF8_Latin1_Translator.h
7 * @author Phil Mesnier <mesnier_p@ociweb.com>
9 //=============================================================================
11 #ifndef UTF8_LATIN1_TRANSLATOR_H
12 #define UTF8_LATIN1_TRANSLATOR_H
13 #include /**/ "ace/pre.h"
15 #include "ace/config-all.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "tao/Codeset/codeset_export.h"
22 #include "tao/Versioned_Namespace.h"
23 #include "ace/CDR_Stream.h"
25 // ****************************************************************
27 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
30 * @class UTF8_Latin1_Translator
32 * @brief Codeset translation specialization - Manages Byte Order Marker
34 * This class performs the codeset translation:
35 * - Native: ISO-8859-1 (i.e. Latin 1)
36 * - Stream: UTF-8 (8 bit unicode mapping)
38 * When writing chars, it is possible to raise a DATA_CONVERSION exception
39 * because some valid Latin codepoints map to 2-byte utf-8 codepoints.
41 * When reading strings, it is possible to raise a DATA_CONVERSION exception
42 * because the string may include utf-8 unicode codepoints > 0x00FF.
44 class TAO_Codeset_Export TAO_UTF8_Latin1_Translator
45 : public ACE_Char_Codeset_Translator
49 TAO_UTF8_Latin1_Translator () = default;
51 /// Virtual destruction
52 virtual ~TAO_UTF8_Latin1_Translator () = default;
54 // = Documented in $ACE_ROOT/ace/CDR_Stream.h
55 virtual ACE_CDR::Boolean
read_char (ACE_InputCDR
&,
57 virtual ACE_CDR::Boolean
read_string (ACE_InputCDR
&,
59 virtual ACE_CDR::Boolean
read_string (ACE_InputCDR
&,
61 virtual ACE_CDR::Boolean
read_char_array (ACE_InputCDR
&,
64 virtual ACE_CDR::Boolean
write_char (ACE_OutputCDR
&,
66 virtual ACE_CDR::Boolean
write_string (ACE_OutputCDR
&,
68 const ACE_CDR::Char
*);
69 virtual ACE_CDR::Boolean
write_char_array (ACE_OutputCDR
&,
70 const ACE_CDR::Char
*,
72 virtual ACE_CDR::ULong
ncs () {return 0x00010001U
;}
73 virtual ACE_CDR::ULong
tcs () {return 0x05010001U
;}
76 ACE_CDR::ULong
read_char_i (ACE_InputCDR
&, ACE_CDR::Char
&);
78 ACE_CDR::Boolean
write_char_i (ACE_OutputCDR
&, ACE_CDR::Char
);
81 TAO_END_VERSIONED_NAMESPACE_DECL
83 #include /**/ "ace/post.h"
84 #endif /* UTF8_LATIN1_TRANSLATOR_H */