1 | /*
|
---|
2 | * @author STF 276
|
---|
3 | * @version $Id$
|
---|
4 | * @desc A collection of text string type and value definitions which
|
---|
5 | * may be useful in the implementation of any TTCN-3 test
|
---|
6 | * suite. "Text string" refers to TTCN-3 charstring and universal
|
---|
7 | * charstring types.
|
---|
8 | * @remark End users should be aware that any changes made to the in
|
---|
9 | * definitions this module may be overwritten in future releases.
|
---|
10 | * End users are encouraged to contact the distributers of this
|
---|
11 | * module regarding their modifications or additions so that future
|
---|
12 | * updates will include your changes.
|
---|
13 | */
|
---|
14 | module LibCommon_TextStrings {
|
---|
15 |
|
---|
16 | /*
|
---|
17 | * @desc These constants can be used to add special characters into
|
---|
18 | * TTCN-3 text strings by using the concatenation operator.
|
---|
19 | * Example use:
|
---|
20 | * var charstring v_text := "Hi!" & c_CRLF & "Hello!";
|
---|
21 | */
|
---|
22 | group usefulConstants {
|
---|
23 |
|
---|
24 | const charstring c_NUL := oct2str('00'O);
|
---|
25 | const charstring c_SOH := oct2str('01'O);
|
---|
26 | const charstring c_STX := oct2str('02'O);
|
---|
27 | const charstring c_ETX := oct2str('03'O);
|
---|
28 | const charstring c_EOT := oct2str('04'O);
|
---|
29 | const charstring c_ENQ := oct2str('05'O);
|
---|
30 | const charstring c_ACK := oct2str('06'O);
|
---|
31 | const charstring c_BEL := oct2str('07'O);
|
---|
32 | const charstring c_BS := oct2str('08'O);
|
---|
33 | const charstring c_TAB := oct2str('09'O);
|
---|
34 | const charstring c_LF := oct2str('0A'O);
|
---|
35 | const charstring c_VT := oct2str('0B'O);
|
---|
36 | const charstring c_FF := oct2str('0C'O);
|
---|
37 | const charstring c_CR := oct2str('0D'O);
|
---|
38 | const charstring c_SO := oct2str('0E'O);
|
---|
39 | const charstring c_SI := oct2str('0F'O);
|
---|
40 | const charstring c_DLE := oct2str('10'O);
|
---|
41 | const charstring c_DC1 := oct2str('11'O);
|
---|
42 | const charstring c_DC2 := oct2str('12'O);
|
---|
43 | const charstring c_DC3 := oct2str('13'O);
|
---|
44 | const charstring c_DC4 := oct2str('14'O);
|
---|
45 | const charstring c_NAK := oct2str('15'O);
|
---|
46 | const charstring c_SYN := oct2str('16'O);
|
---|
47 | const charstring c_ETB := oct2str('17'O);
|
---|
48 | const charstring c_CAN := oct2str('18'O);
|
---|
49 | const charstring c_EM := oct2str('19'O);
|
---|
50 | const charstring c_SUB := oct2str('1A'O);
|
---|
51 | const charstring c_ESC := oct2str('1B'O);
|
---|
52 | const charstring c_FS := oct2str('1C'O);
|
---|
53 | const charstring c_GS := oct2str('1D'O);
|
---|
54 | const charstring c_RS := oct2str('1E'O);
|
---|
55 | const charstring c_US := oct2str('1F'O);
|
---|
56 | const charstring c_DEL := oct2str('7F'O);
|
---|
57 |
|
---|
58 | const charstring c_CRLF := oct2str('0D'O) & oct2str('0A'O);
|
---|
59 |
|
---|
60 | } // end group usefulConstants
|
---|
61 |
|
---|
62 | /*
|
---|
63 | * @remark Number in name indicates string length in number of
|
---|
64 | * _chars_
|
---|
65 | */
|
---|
66 | group textStringSubTypes {
|
---|
67 |
|
---|
68 | type charstring String1 length(1) with { encode "1 byte"};
|
---|
69 | type charstring String2 length(2) with { encode "2 bytes"};
|
---|
70 | type charstring String3 length(3) with { encode "3 bytes"};
|
---|
71 | type charstring String4 length(4) with { encode "4 bytes"};
|
---|
72 | type charstring String5 length(5) with { encode "5 bytes"};
|
---|
73 | type charstring String6 length(6) with { encode "6 bytes"};
|
---|
74 | type charstring String7 length(7) with { encode "7 bytes"};
|
---|
75 | type charstring String8 length(8) with { encode "8 bytes"};
|
---|
76 | type charstring String9 length(9) with { encode "9 bytes"};
|
---|
77 | type charstring String10 length(10) with { encode "10 bytes"};
|
---|
78 | type charstring String11 length(11) with { encode "11 bytes"};
|
---|
79 | type charstring String12 length(12) with { encode "12 bytes"};
|
---|
80 | type charstring String13 length(13) with { encode "13 bytes"};
|
---|
81 | type charstring String14 length(14) with { encode "14 bytes"};
|
---|
82 | type charstring String15 length(15) with { encode "15 bytes"};
|
---|
83 | type charstring String16 length(16) with { encode "16 bytes"};
|
---|
84 |
|
---|
85 | type charstring String1To63 length(1..63) with {encode "1 to 63 bytes"};
|
---|
86 | type charstring String1To64 length(1..64) with {encode "1 to 64 bytes"};
|
---|
87 | type charstring String1To127 length(1..127) with {encode "1 to 127 bytes"};
|
---|
88 | type charstring String1To128 length(1..128) with {encode "1 to 128 bytes"};
|
---|
89 | type charstring String1to255 length(1..255) with {encode "1 to 255 bytes"};
|
---|
90 |
|
---|
91 | } // end stringSubTypes
|
---|
92 |
|
---|
93 | group usefulTextStringTypes {
|
---|
94 |
|
---|
95 | // NOTE STS: below universal commented due to serious RTS problems in Tau 2.3 and before
|
---|
96 | type /*universal*/ charstring UnicodeText;
|
---|
97 |
|
---|
98 | // NOTE STS: below universal commented due to serious RTS problems in Tau 2.3 and before
|
---|
99 | type /*universal*/ charstring UnicodeText1to255 length(1..255)
|
---|
100 | with {encode "1 to 255 bytes"};
|
---|
101 |
|
---|
102 | type charstring AlphaNum ("0".."9","a".."z","A".."Z");
|
---|
103 | type AlphaNum AlphaNum2 length(2);
|
---|
104 | type AlphaNum AlphaNum1To32 length(1..32);
|
---|
105 |
|
---|
106 | } // end group usefulTextStringTypes
|
---|
107 |
|
---|
108 | } // end module LibCommon_TextStrings
|
---|