This file is indexed.

/usr/share/titan/help/info/octetstring.html is in eclipse-titan 6.3.1-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!--
 Copyright (c) 2000-2017 Ericsson Telecom AB
 All rights reserved. This program and the accompanying materials
 are made available under the terms of the Eclipse Public License v1.0
 which accompanies this distribution, and is available at
 http://www.eclipse.org/legal/epl-v10.html

 Contributors:
  Baji, Laszlo
  Balasko, Jeno
  Csorba, Mate
  Farkas, Laszlo
  Forstner, Matyas
  Szabados, Kristof
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<title>octetstring</title>
</head>
<body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258">
<table align="left" border="0" cellspacing="0" cellpadding="0" valign=top>
  <tr>
    <td width=105 height=40><a href="https://projects.eclipse.org/projects/tools.titan"><img src="../images/titan_transparent.gif" border=0 width=105 height=40 align="left" alt="Titan"></a></td>
  </tr>
</table>
<table border="0" align="right" cellpadding="0" cellspacing="0">
  <tr>
    <td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td>
    <td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td>
    <td><a alt="previous" href="oct2unichar.html"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
    <td><a href="of.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td>
  </tr>
</table>
<p><br clear="all">
</p>
<hr>
<h1>octetstring</h1>
<hr align="left" width="75%">
<p>The keyword <b><font face="Courier New">octetstring</font></b> denotes a basic string type whose distinguished values are the ordered sequences of&nbsp; 2n hexadecimal digits where n is a
non-negative integer.</p>
<ul>
  <li>octet string values are written between <a href="#double_quotation"> single quotes and followed by the capital letter O.</a> (' 'O).</li>
  <li>A octet string may be specified by its integer value using a <a href="#conversion">conversion function</a>.</li>
  <li>The <a href="#relation">relational operators</a> equality (==) and non-equality (!=) can be used to compare values of two octet strings</li>
  <li>The <a href="#shift">shift operators</a> perform the shift left (&lt;&lt;) and shift right (&gt;&gt;) operations.</li>
  <li>The <a href="#rotate">rotate operators</a> perform the rotate left (&lt;@) and rotate right (@&gt;) operations.</li>
  <li>The <a href="#concatenation"> concatenation operator</a> (&amp;) performs a simple concatenation from left to right.</li>
  <li>Bitwise operators (<a href="and4b.html">and4b</a>, <a href="not4b.html">not4b</a>, <a href="or4b.html">or4b</a>, <a href="xor4b.html"
    target="_blank">xor4b</a>) are used to manipulate bits in the string.</li>
  <li>A <a href="#array"> single octet</a> may be accessed using an array-like syntax. The leftmost octet has the index zero.</li>
  <li>The octet string may be <a href="#vacuum">empty</a>.</li>
  <li>The length of the octet string can be constrained using the keyword <a href="length.html"><b><font face="Courier New" color="#003258" size="4">length</font></b></a>.</li>
  <li>Another way to limit the permitted values of an octet string is <a href="#list">to list them</a>.</li>
  <li>Predefined functions operating on octet strings:</li>
  <ul>
    <li><a href="#bit2hex">oct2hex</a> converts an octet string value to a hexadecimal string.</li>
    <li><a href="#str2int">oct2int</a> converts an octet string to the equivalent integer.</li>
    <li><a href="#str2oct">oct2bit</a> converts an octet string to a binary string.</li>
    <li><a href="#bit2str">oct2str</a> displays an octet string as a character string.</li>
    <li><a href="#oct2unichar">oct2unichar</a> converts an octet string as an universal character string.</li>
    <li><a href="#unichar2oct">unichar2oct</a> converts an universal charcter string  to an octet string.</li>
    <li><a href="#lengthof">lengthof</a> returns an integer value indicating the number of octets in a string.</li>
    <li><a href="#get_stringencoding">get_stringencoding</a> identifies the encoding of an octet string.</li>
    <li><a href="#remove_bom">remove_bom</a> strips the BOM if it is present or returns the original octet string.</li>
  </ul>
</ul>
<div align="center">
<center>
<table border="0" width="100%" bgcolor="#C9C2BB" cellpadding="4">
  <tr>
    <td width="100%">
    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>TITAN specific extension to the standard:</u></p>
    <ul>
      <ul>
        <li><a href="#oct2char">oct2char</a> converts an octet string to a character string.</li>
      </ul>
    </ul>
    </td>
  </tr>
</table>
</center>
</div>
<p>Related keywords:</p>
<ul>
  <li><a href="bit2oct.html"><b><font face="Courier New" color="#003258" size="4">bit2oct</font></b></a></li>
  <li><a href="char2oct.html"><b><font face="Courier New" color="#003258" size="4">char2oct</font></b></a></li>
  <li><a href="hex2oct.html"><b><font face="Courier New" color="#003258" size="4">hex2oct</font></b></a></li>
  <li><a href="int2oct.html"><b><font face="Courier New" color="#003258" size="4">int2oct</font></b></a></li>
  <li><a href="length.html"><b><font face="Courier New" color="#003258" size="4">length</font></b></a></li>
  <li><a href="lengthof.html"><b><font face="Courier New" color="#003258" size="4">lengthof</font></b></a></li>
  <li><a href="oct2bit.html"><b><font face="Courier New" color="#003258" size="4">oct2bit</font></b></a></li>
  <li><a href="oct2char.html"><b><font face="Courier New" color="#003258" size="4">oct2char</font></b></a></li>
  <li><a href="oct2hex.html"><b><font face="Courier New" color="#003258" size="4">oct2hex</font></b></a></li>
  <li><a href="oct2int.html"><b><font face="Courier New" color="#003258" size="4">oct2int</font></b></a></li>
  <li><a href="oct2unichar.html"><b><font face="Courier New" color="#003258" size="4">oct2unichar</font></b></a></li>
  <li><a href="unichar2oct.html"><b><font face="Courier New" color="#003258" size="4">unichar2oct</font></b></a></li>
  <li><a href="oct2str.html"><b><font face="Courier New" color="#003258" size="4">oct2str</font></b></a></li>
  <li><a href="get_stringencoding.html"><b><font face="Courier New" color="#003258" size="4">get_stringencoding</font></b></a></li>
  <li><a href="remove_bom.html"><b><font face="Courier New" color="#003258" size="4">remove_bom</font></b></a></li>
  <li><a href="str2oct.html"><b><font face="Courier New" color="#003258" size="4">str2oct</font></b></a></li>
  <li><a href="substr.html"><b><font face="Courier New" color="#003258" size="4">substr</font></b></a></li>
  <li><a href="and4b.html"><b><font face="Courier New" color="#003258" size="4">and4bit</font></b></a></li>
  <li><a href="not4b.html"><b><font face="Courier New" color="#003258" size="4">not4bit</font></b></a></li>
  <li><a href="or4b.html"><b><font face="Courier New" color="#003258" size="4">or4bit</font></b></a></li>
  <li><a href="xor4b.html"><b><font face="Courier New" color="#003258" size="4">xor4bit</font></b></a></li>
</ul>
<hr align="left" width="50%">
<div align="center">
<center>
<table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
  <tr>
    <td width="100%">
    <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>octetstring</b></font></h3>
    </td>
  </tr>
</table>
</center>
</div>
<hr align="left" width="50%">
<p><a name="double_quotation">Example 1</a>:
<p><font face="Courier New">const octetstring c_ok := 'A5'O;<br>
</font>
<p>The constant defined is called c_ok and contains the octet string A5.</p>
<hr align="left" width="50%">
<p><a name="conversion">Example 2</a>:
<p><font face="Courier New">const octetstring c_entier := int2oct (266,2);<br>
</font>
<p>The constant c_entier will contain the octet string 010A because the converted integer number (127 -&gt; 10A) must be coded on 2 octets and therefore padded with a leading zero.</p>
<hr align="left" width="50%">
<p><a name="relation">Example 3</a>:
<p><font face="Courier New">const boolean c_niet := ( c_entier == c_ok );<br>
</font>
<p>The constant c_niet will have the value false, because two octet strings are not equal. The parentheses are optional.</p>
<hr align="left" width="50%">
<p><a name="concatenation">Example 4</a>:
<p><font face="Courier New">const octetstring c_clotre := c_entier &amp; c_ok;<br>
</font>
<p>The constant c_clotre will contain the octet string 010AA5&nbsp;</p>
<hr align="left" width="50%">
<p><a name="array">Example 5</a>:
<p><font face="Courier New">const octetstring c_samotny := c_entier[1];<br>
</font>
<p>The constant called c_samotny will contain the octet string 0A.</p>
<hr align="left" width="50%">
<p><a name="vacuum">Example 6</a>:
<p><font face="Courier New">const octetstring c_nil := ''O;<br>
</font>
<p>The constant called c_nil will be an empty string.</p>
<hr align="left" width="50%">
<p><a name="bit2hex">Example 7a</a>:
<p><font face="Courier New">const hexstring c_kungsen := oct2hex ('AA'O);</font><br>
<p>The constant called c_kungsen will have the hexadecimal value AA. Although&nbsp;both values on the screen may look the same (AA), they have different types (octet string respective character
string).</p>
<hr align="left" width="50%">
<p><a name="str2int">Example 7b</a>:
<p><font face="Courier New">const integer c_prednost := oct2int ('55'O);<br>
</font>
<p>The constant called c_prednost will have the integer value 85. The result will be always positive.</p>
<hr align="left" width="50%">
<p><a name="str2oct">Example 7c</a>:
<p><font face="Courier New">const bitstring c_kvar := oct2bit ('44'O);<br>
</font>
<p>The constant called c_kvar will contain the bit string 01000100.</p>
<hr align="left" width="50%">
<p><a name="bit2str">Example 7d</a>:
<p><font face="Courier New">const charstring c_lettres := oct2str ('80FBBC0530A0'O);<br>
</font>
<p>The constant called c_lettres will contain the string 80FBBC0530A0 because the resulting character string has the double length as the octet string and contains only the characters '0' .. 'F'.</p>
<hr align="left" width="50%">
<p><a name="lengthof">Example 7e</a>:
<p><font face="Courier New">const integer c_laenge := lengthof ('80FBBC0530A0'O);<br>
</font>
<p>The constant called c_laenge will have the value 6 corresponding to the number of octets in the string .</p>
<hr align="left" width="50%">
<p><a name="oct2char">Example 7f</a>:
<p><font face="Courier New">const charstring c_specific := oct2char (’4469707379’O);<br>
</font>
<p>The constant called c_specific will contain the string &quot;Dipsy&quot; because the resulting character string will have the same length as the incoming octet string. The octets are
interpreted as ISO/IEC 646 [8] codes (according to the IRV) and the resulting characters are stored in the returned string. Octet values higher than 7F cause an error.</p>
<hr align="left" width="50%">
<p><a name="list">Example 8</a>:
<p><font face="Courier New">var octetstring c_hinder ('1010'O,'77'O,'AA55CC'O );<br>
</font>
<p>The variable called c_hinder may hold the octet strings 1010, 77 and AA55CC only.</p>
<hr align="left" width="50%">
<p><a name="rotate">Example 9</a>:&nbsp;</p>
<p><font face="Courier New">const octetstring c_go_round := '1122334455'O &lt;@ (1+2);<br>
</font>
<p>The constant called c_go_round will hold the value '4455112233'O (the left operand rotated by three octets).</p>
<hr align="left" width="50%">
<p><a name="shift">Example 10</a>:</p>
<p><font face="Courier New">const octetstring c_slip := '1122334455'O &lt;&lt; (1+1);<br>
</font>
<p>The constant called c_slip will hold the value '3344550000'O (the left operand shifted by two octets) .</p>
<hr align="left" width="25%">
<hr align="left" width="25%">
<p align="left"><a HREF="BNF.html#bitstringkeyword">BNF definition</a> of <font face="Courier New">octetstring</font><br>
<a HREF="BNF.html#bitstringvalue">BNF definition</a> of octetstring value</p>
</body>
</html>