Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / CodeSets / libs / UCS4_UTF16 / WUCS4_UTF16.h
blob950318eb5a14696c1d6422f356717f2668035b7e
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file WUCS4_UTF16.h
7 * @author Phil Mesnier <mesnier_p@ociweb.com>
8 */
9 //=============================================================================
11 #ifndef WUCS4_UTF16_H
12 #define WUCS4_UTF16_H
13 #include /**/ "ace/pre.h"
15 #include "ace/config-all.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 # pragma once
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "ace/CDR_Stream.h"
22 #include "WUCS4_UTF16_export.h"
24 // ****************************************************************
26 /**
27 * @class ACE_Char_UCS4_UTF16
29 * @brief Codeset translation specialization.
31 * This class performs the codeset translation:
32 * - Native: IBM_1047 (i.e. EBCDIC)
33 * - Stream: ISO-8859 (i.e. Latin/1)
35 class UCS4_UTF16_Export WUCS4_UTF16 : public ACE_WChar_Codeset_Translator
37 public:
38 /// A do nothing constructor.
39 WUCS4_UTF16 ();
41 /// Virtual destruction
42 virtual ~WUCS4_UTF16 ();
44 // = Documented in $ACE_ROOT/ace/CDR_Stream.h
45 virtual ACE_CDR::Boolean read_wchar (ACE_InputCDR &,
46 ACE_CDR::WChar &);
47 virtual ACE_CDR::Boolean read_wstring (ACE_InputCDR &,
48 ACE_CDR::WChar *&);
49 virtual ACE_CDR::Boolean read_wchar_array (ACE_InputCDR &,
50 ACE_CDR::WChar *,
51 ACE_CDR::ULong);
52 virtual ACE_CDR::Boolean write_wchar (ACE_OutputCDR &,
53 ACE_CDR::WChar);
54 virtual ACE_CDR::Boolean write_wstring (ACE_OutputCDR &,
55 ACE_CDR::ULong,
56 const ACE_CDR::WChar *);
57 virtual ACE_CDR::Boolean write_wchar_array (ACE_OutputCDR &,
58 const ACE_CDR::WChar *,
59 ACE_CDR::ULong);
60 virtual ACE_CDR::ULong ncs () {return 0x00010104;}
61 virtual ACE_CDR::ULong tcs () {return 0x00010109;}
63 private:
64 ACE_CDR::Boolean read_wchar_array_i (ACE_InputCDR &,
65 ACE_CDR::WChar *,
66 ACE_CDR::ULong&,
67 int adjust_len = 0);
69 ACE_CDR::Boolean write_wchar_i (ACE_OutputCDR &,
70 ACE_CDR::WChar ,
71 int use_BOM,
72 int encode_len);
74 /**
75 Due to surrogate pair substution the transmitted length of a wstring can
76 differ from the logical strength length. This version of write_wchar_array
77 accepts both lengths and uses them as necessary.
79 ACE_CDR::Boolean write_measured_wchar_array (
80 ACE_OutputCDR & cdr,
81 const ACE_CDR::WChar *x,
82 ACE_CDR::ULong length,
83 ACE_CDR::ULong transmission_length);
86 #include /**/ "ace/post.h"
87 #endif /* WCHAR_UCS4_UTF16_TRANSLATOR */