3 //=============================================================================
5 * @file UTF16_BOM_Translator.h
7 * @author Phil Mesnier <mesnier_p@ociweb.com>
9 //=============================================================================
11 #ifndef UTF16_BOM_TRANSLATOR_H
12 #define UTF16_BOM_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"
26 // ****************************************************************
28 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
31 * @class TAO_UTF16_BOM_Translator
33 * @brief Codeset translation specialization - Manages Byte Order Marker
35 * This class performs the codeset translation:
36 * - Native: UTF16 (i.e. Unicode)
37 * - Stream: UTF16 with Byte Order Marker
39 class TAO_Codeset_Export TAO_UTF16_BOM_Translator
40 : public ACE_WChar_Codeset_Translator
44 /// @param forceBE: true forces all wchar, warray, and wstrings to big-endian byte order
45 TAO_UTF16_BOM_Translator (bool forceBE
);
47 /// Virtual destruction
48 virtual ~TAO_UTF16_BOM_Translator (void);
50 // = Documented in $ACE_ROOT/ace/CDR_Stream.h
51 virtual ACE_CDR::Boolean
read_wchar (ACE_InputCDR
&,
53 virtual ACE_CDR::Boolean
read_wstring (ACE_InputCDR
&,
55 #if !defined(ACE_LACKS_STD_WSTRING)
56 virtual ACE_CDR::Boolean
read_wstring (ACE_InputCDR
&,
59 virtual ACE_CDR::Boolean
read_wchar_array (ACE_InputCDR
&,
62 virtual ACE_CDR::Boolean
write_wchar (ACE_OutputCDR
&,
64 virtual ACE_CDR::Boolean
write_wstring (ACE_OutputCDR
&,
66 const ACE_CDR::WChar
*);
67 virtual ACE_CDR::Boolean
write_wchar_array (ACE_OutputCDR
&,
68 const ACE_CDR::WChar
*,
70 virtual ACE_CDR::ULong
ncs () {return 0x00010109;}
71 virtual ACE_CDR::ULong
tcs () {return 0x00010109;}
74 ACE_CDR::Boolean
read_wchar_array_i (ACE_InputCDR
&,
79 ACE_CDR::Boolean
write_wchar_array_i (ACE_OutputCDR
&,
80 const ACE_CDR::WChar
*,
83 ACE_CDR::Boolean
write_swapped_wchar_array_i (ACE_OutputCDR
& cdr
,
84 const ACE_CDR::WChar
*x
,
85 ACE_CDR::ULong length
);
88 ACE_CDR::Boolean
write_wchar_i (ACE_OutputCDR
&,
93 /// if this flag is true, force wchar's to big endian order
98 TAO_END_VERSIONED_NAMESPACE_DECL
100 #include /**/ "ace/post.h"
101 #endif /* UTF16_BOM_TRANSLATOR_H */