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"
24 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
27 * @class TAO_UTF16_BOM_Translator
29 * @brief Codeset translation specialization - Manages Byte Order Marker
31 * This class performs the codeset translation:
32 * - Native: UTF16 (i.e. Unicode)
33 * - Stream: UTF16 with Byte Order Marker
35 class TAO_Codeset_Export TAO_UTF16_BOM_Translator
36 : public ACE_WChar_Codeset_Translator
40 /// @param forceBE: true forces all wchar, warray, and wstrings to big-endian byte order
41 TAO_UTF16_BOM_Translator (bool forceBE
);
43 /// Virtual destruction
44 virtual ~TAO_UTF16_BOM_Translator () = default;
46 // = Documented in $ACE_ROOT/ace/CDR_Stream.h
47 virtual ACE_CDR::Boolean
read_wchar (ACE_InputCDR
&,
49 virtual ACE_CDR::Boolean
read_wstring (ACE_InputCDR
&,
51 #if !defined(ACE_LACKS_STD_WSTRING)
52 virtual ACE_CDR::Boolean
read_wstring (ACE_InputCDR
&,
55 virtual ACE_CDR::Boolean
read_wchar_array (ACE_InputCDR
&,
58 virtual ACE_CDR::Boolean
write_wchar (ACE_OutputCDR
&,
60 virtual ACE_CDR::Boolean
write_wstring (ACE_OutputCDR
&,
62 const ACE_CDR::WChar
*);
63 virtual ACE_CDR::Boolean
write_wchar_array (ACE_OutputCDR
&,
64 const ACE_CDR::WChar
*,
66 virtual ACE_CDR::ULong
ncs () {return 0x00010109;}
67 virtual ACE_CDR::ULong
tcs () {return 0x00010109;}
70 ACE_CDR::Boolean
read_wchar_array_i (ACE_InputCDR
&,
75 ACE_CDR::Boolean
write_wchar_array_i (ACE_OutputCDR
&,
76 const ACE_CDR::WChar
*,
79 ACE_CDR::Boolean
write_swapped_wchar_array_i (ACE_OutputCDR
& cdr
,
80 const ACE_CDR::WChar
*x
,
81 ACE_CDR::ULong length
);
84 ACE_CDR::Boolean
write_wchar_i (ACE_OutputCDR
&,
89 /// if this flag is true, force wchar's to big endian order
93 TAO_END_VERSIONED_NAMESPACE_DECL
95 #include /**/ "ace/post.h"
96 #endif /* UTF16_BOM_TRANSLATOR_H */