summaryrefslogtreecommitdiff
path: root/ACE/ace/Codeset_IBM1047.h
blob: 3bbc7ba0c447e0ac0af701b6bb3b715676529550 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// -*- C++ -*-

//=============================================================================
/**
 *  @file    Codeset_IBM1047.h
 *
 *  $Id$
 *
 *  Declares the arrays required to convert between ISO8859 (aka
 *  Latin/1) and IBM1047 (aka EBCDIC).
 *
 *  @author Jim Rogers (jrogers@viasoft.com)
 */
//=============================================================================


#ifndef ACE_CODESET_IMB1047_H
#define ACE_CODESET_IMB1047_H
#include /**/ "ace/pre.h"

#include /**/ "ace/config-all.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#if defined (ACE_HAS_EBCDIC)

#include "ace/CDR_Stream.h"

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

// ****************************************************************

/**
 * @class ACE_IBM1047_ISO8859
 *
 * @brief Codeset translation specialization.
 *
 * This class performs the codeset translation:
 *   - Native:        IBM_1047 (i.e. EBCDIC)
 *   - Stream:        ISO-8859 (i.e. Latin/1)
 */
class ACE_Export ACE_IBM1047_ISO8859 : public ACE_Char_Codeset_Translator
{
public:
  /// A do nothing constructor.
  ACE_IBM1047_ISO8859 (void);

  /// Virtual destruction
  virtual ~ACE_IBM1047_ISO8859 (void);

  // = Documented in $ACE_ROOT/ace/CDR_Stream.h
  virtual ACE_CDR::Boolean read_char (ACE_InputCDR &,
                                      ACE_CDR::Char &);
  virtual ACE_CDR::Boolean read_string (ACE_InputCDR &,
                                        ACE_CDR::Char *&);
  virtual ACE_CDR::Boolean read_char_array (ACE_InputCDR &,
                                            ACE_CDR::Char *,
                                            ACE_CDR::ULong);
  virtual ACE_CDR::Boolean write_char (ACE_OutputCDR &,
                                       ACE_CDR::Char);
  virtual ACE_CDR::Boolean write_string (ACE_OutputCDR &,
                                         ACE_CDR::ULong,
                                         const ACE_CDR::Char *);
  virtual ACE_CDR::Boolean write_char_array (ACE_OutputCDR &,
                                             const ACE_CDR::Char *,
                                             ACE_CDR::ULong);

  /// Return the native codeset ID as defined in the OSF code and character
  /// set registry, 0x10020417
  virtual ACE_CDR::ULong ncs ();
  /// Return the translated codeset ID as defined in the OSF code and character
  /// set registry, 0x00010001
  virtual ACE_CDR::ULong tcs ();
};

/**
 * @class ACE_ISO8859_IBM1047
 *
 * @brief Codeset translation specialization.
 *
 * This class performs the codeset translation:
 *   - Native:        ISO-8859 (i.e. Latin/1)
 *   - Stream:        IBM-1047 (i.e. EBCDIC)
 */
class ACE_Export ACE_ISO8859_IBM1047 : public ACE_Char_Codeset_Translator
{
public:
  /// A do nothing constructor.
  ACE_ISO8859_IBM1047 (void);

  /// Virtual destruction
  virtual ~ACE_ISO8859_IBM1047 (void);

  // = Documented in $ACE_ROOT/ace/CDR_Stream.h
  virtual ACE_CDR::Boolean read_char (ACE_InputCDR &,
                                      ACE_CDR::Char &);
  virtual ACE_CDR::Boolean read_string (ACE_InputCDR &,
                                        ACE_CDR::Char *&);
  virtual ACE_CDR::Boolean read_char_array (ACE_InputCDR &,
                                            ACE_CDR::Char *,
                                            ACE_CDR::ULong);
  virtual ACE_CDR::Boolean write_char (ACE_OutputCDR &,
                                       ACE_CDR::Char);
  virtual ACE_CDR::Boolean write_string (ACE_OutputCDR &,
                                         ACE_CDR::ULong,
                                         const ACE_CDR::Char *);
  virtual ACE_CDR::Boolean write_char_array (ACE_OutputCDR &,
                                             const ACE_CDR::Char *,
                                             ACE_CDR::ULong);

  /// Return the native codeset ID as defined in the OSF code and character
  /// set registry, 0x00010001
  virtual ACE_CDR::ULong ncs ();
  /// Return the translated codeset ID as defined in the OSF code and character
  /// set registry, 0x10020417
  virtual ACE_CDR::ULong tcs ();
};

ACE_END_VERSIONED_NAMESPACE_DECL

#endif /* ACE_EBCDIC */

#include /**/ "ace/post.h"

#endif /* ACE_CODESET_IMB1047_H */