1 // Tags: not-a-test |
|
2 // Copyright (c) 2000, 2001 NEC Corporation. |
|
3 |
|
4 // Adapted for Mauve by Audrius Meskauskas <audriusa@bluewin.ch> |
|
5 |
|
6 // This file is part of Mauve. |
|
7 |
|
8 // Mauve is free software; you can redistribute it and/or modify |
|
9 // it under the terms of the GNU General Public License as published by |
|
10 // the Free Software Foundation; either version 2, or (at your option) |
|
11 // any later version. |
|
12 |
|
13 // Mauve is distributed in the hope that it will be useful, |
|
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 // GNU General Public License for more details. |
|
17 |
|
18 // You should have received a copy of the GNU General Public License |
|
19 // along with Mauve; see the file COPYING. If not, write to |
|
20 // the Free Software Foundation, 59 Temple Place - Suite 330, |
|
21 // Boston, MA 02111-1307, USA. |
|
22 |
|
23 /* |
|
24 This code originally came from the OMG's CORBA Open Source Testing project, |
|
25 which lived at cost.omg.org. That site no longer exists. |
|
26 |
|
27 All the contributing companies agreed to release their tests under the |
|
28 terms of the GNU Lesser General Public License, available in the file |
|
29 COPYING.LIB. |
|
30 |
|
31 The code has been modified integrating into Mauve test environment and |
|
32 removing tests that are not yet supported by Suns jre 1.4. Hence the license |
|
33 is now GPL. |
|
34 |
|
35 We downloaded the code from http://sourceforge.net/projects/corba-cost/, |
|
36 administrated by Duncan Grisby. |
|
37 */ |
|
38 |
|
39 package gnu.testlet.org.omg.CORBA.ORB.RF11; |
|
40 |
|
41 public abstract class C_array_e_stringHelper |
|
42 { |
|
43 private static String _id = "IDL:gnu/testlet/org/omg/CORBA/ORB/RF11/C_array_e_string:1.0"; |
|
44 |
|
45 public static void insert(org.omg.CORBA.Any a, String[] that) |
|
46 { |
|
47 org.omg.CORBA.portable.OutputStream out = a.create_output_stream(); |
|
48 a.type(type()); |
|
49 write(out, that); |
|
50 a.read_value(out.create_input_stream(), type()); |
|
51 } |
|
52 |
|
53 public static String[] extract(org.omg.CORBA.Any a) |
|
54 { |
|
55 return read(a.create_input_stream()); |
|
56 } |
|
57 |
|
58 private static org.omg.CORBA.TypeCode __typeCode = null; |
|
59 |
|
60 public static synchronized org.omg.CORBA.TypeCode type() |
|
61 { |
|
62 if (__typeCode == null) |
|
63 { |
|
64 __typeCode = org.omg.CORBA.ORB.init().create_string_tc(0); |
|
65 __typeCode = org.omg.CORBA.ORB.init().create_array_tc(2, __typeCode); |
|
66 __typeCode = |
|
67 org.omg.CORBA.ORB.init().create_alias_tc(C_array_e_stringHelper.id(), |
|
68 "C_array_e_string", |
|
69 __typeCode |
|
70 ); |
|
71 } |
|
72 return __typeCode; |
|
73 } |
|
74 |
|
75 public static String id() |
|
76 { |
|
77 return _id; |
|
78 } |
|
79 |
|
80 public static String[] read(org.omg.CORBA.portable.InputStream istream) |
|
81 { |
|
82 String[] value = null; |
|
83 value = new String[ 2 ]; |
|
84 for (int _o0 = 0; _o0 < (2); ++_o0) |
|
85 { |
|
86 value [ _o0 ] = istream.read_string(); |
|
87 } |
|
88 return value; |
|
89 } |
|
90 |
|
91 public static void write(org.omg.CORBA.portable.OutputStream ostream, |
|
92 String[] value |
|
93 ) |
|
94 { |
|
95 if (value.length != (2)) |
|
96 throw new org.omg.CORBA.MARSHAL(0, |
|
97 org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE |
|
98 ); |
|
99 for (int _i0 = 0; _i0 < (2); ++_i0) |
|
100 { |
|
101 ostream.write_string(value [ _i0 ]); |
|
102 } |
|
103 } |
|
104 } |
|