Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / CodeSets / libs / UTF16_UCS2 / UTF16_UCS2_Translator.h
blobf724706ee3b90784946680cfcbe408e853142564
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file UTF16_UCS2_Translator.h
7 * @author Iliyan Jeliazkov <jeliazkov_i@ociweb.com>
8 * @author Byron Harris <harrisb@ociweb.com>
9 */
10 //=============================================================================
12 #ifndef UTF16_UCS2_TRANSLATOR_H
13 #define UTF16_UCS2_TRANSLATOR_H
14 #include /**/ "ace/pre.h"
16 #include "ace/config-all.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/CDR_Stream.h"
23 #include "ace/Codeset_Symbols.h"
24 #include "tao/CONV_FRAMEC.h"
25 #include "UTF16_UCS2_export.h"
27 // ****************************************************************
29 /**
30 * @class UTF16_UCS2_Translator
32 * @brief Codeset translation specialization
34 * This class performs the codeset translation:
35 * - Native: UTF16 (i.e. Unicode)
36 * - Stream: UCS2
38 class UTF16_UCS2_Export UTF16_UCS2_Translator : public ACE_WChar_Codeset_Translator
40 public:
41 /// constructor
42 /// @param tcs: the target codeset id to use (and report)
43 UTF16_UCS2_Translator (CONV_FRAME::CodeSetId tcs = ACE_CODESET_ID_ISO_UCS_2_LEVEL_1);
45 /// Virtual destruction
46 virtual ~UTF16_UCS2_Translator ();
48 // = Documented in $ACE_ROOT/ace/CDR_Stream.h
49 virtual ACE_CDR::Boolean read_wchar (ACE_InputCDR &,
50 ACE_CDR::WChar &);
51 virtual ACE_CDR::Boolean read_wstring (ACE_InputCDR &,
52 ACE_CDR::WChar *&);
53 virtual ACE_CDR::Boolean read_wchar_array (ACE_InputCDR &,
54 ACE_CDR::WChar *,
55 ACE_CDR::ULong);
56 virtual ACE_CDR::Boolean write_wchar (ACE_OutputCDR &,
57 ACE_CDR::WChar);
58 virtual ACE_CDR::Boolean write_wstring (ACE_OutputCDR &,
59 ACE_CDR::ULong,
60 const ACE_CDR::WChar *);
61 virtual ACE_CDR::Boolean write_wchar_array (ACE_OutputCDR &,
62 const ACE_CDR::WChar *,
63 ACE_CDR::ULong);
64 virtual ACE_CDR::ULong ncs () {return 0x00010109;}
65 virtual ACE_CDR::ULong tcs () {return this->tcs_;}
67 private:
68 ACE_CDR::Boolean read_wchar_array_i (ACE_InputCDR &,
69 ACE_CDR::WChar *,
70 ACE_CDR::ULong&,
71 int adjust_len = 0);
73 ACE_CDR::Boolean write_wchar_array_i (ACE_OutputCDR &,
74 const ACE_CDR::WChar *,
75 ACE_CDR::ULong);
77 ACE_CDR::Boolean write_swapped_wchar_array_i (ACE_OutputCDR & cdr,
78 const ACE_CDR::WChar *x,
79 ACE_CDR::ULong length);
82 ACE_CDR::Boolean write_wchar_i (ACE_OutputCDR &,
83 ACE_CDR::WChar);
85 private:
86 CONV_FRAME::CodeSetId tcs_;
89 #include /**/ "ace/post.h"
90 #endif /* UTF16_UCS2_TRANSLATOR_H */