Changeset 12368


Ignore:
Timestamp:
Jul 7, 2009, 8:42:05 PM (10 years ago)
Author:
rme
Message:

Export and document string-size-in-octets, encode-string-to-octets,
count-characters-in-octet-vector, and decode-string-from-octets.

(ticket:532)

Location:
trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/doc/src/using.xml

    r12330 r12368  
    10981098       <para>Alias: <literal>:UCS-4LE</literal></para></listitem>
    10991099     </varlistentry>
    1100   </variablelist>
    1101     </sect3>
     1100   </variablelist>
     1101 </sect3>
     1102
     1103 <sect3><title>Encoding and Decoding Strings</title>
     1104 <para>&CCL; provides functions to encode and decode strings
     1105to and from vectors of type (simple-array (unsigned-byte 8)).</para>
     1106
     1107<refentry id="count-characters-in-octet-vector">
     1108  <indexterm zone="count-characters-in-octet-vector">
     1109    <primary>count-characters-in-octet-vector</primary>
     1110  </indexterm>
     1111
     1112  <refnamediv>
     1113    <refname>count-characters-in-octet-vector</refname>
     1114    <refpurpose></refpurpose>
     1115    <refclass>Function</refclass>
     1116  </refnamediv>
     1117
     1118  <refsynopsisdiv>
     1119    <synopsis>
     1120        <function>count-characters-in-octet-vector</function>
     1121        <parameter>vector</parameter>
     1122        <parameter>&key;</parameter>
     1123        <parameter>start</parameter>
     1124        <parameter>end</parameter>
     1125        <parameter>external-format</parameter>
     1126    </synopsis>
     1127  </refsynopsisdiv>
     1128
     1129  <refsect1><title>Description</title>
     1130  <para>
     1131    Returns the number of characters that would be produced by
     1132    decoding <varname>vector</varname> (or the subsequence thereof
     1133    delimited by <varname>start</varname> and <varname>end</varname>)
     1134    according to <varname>external-format</varname>.
     1135  </para>
     1136  </refsect1>
     1137</refentry>
     1138
     1139<refentry id="decode-string-from-octets">
     1140  <indexterm zone="decode-string-from-octets">
     1141    <primary>"decode-string-from-octets</primary>
     1142  </indexterm>
     1143
     1144  <refnamediv>
     1145    <refname>decode-string-from-octets</refname>
     1146    <refpurpose></refpurpose>
     1147    <refclass>Function</refclass>
     1148  </refnamediv>
     1149
     1150  <refsynopsisdiv>
     1151    <synopsis>
     1152        <function>decode-string-from-octets</function>
     1153        <parameter>vector</parameter>
     1154        <parameter>&key;</parameter>
     1155        <parameter>start</parameter>
     1156        <parameter>end</parameter>
     1157        <parameter>external-format</parameter>
     1158        <parameter>string</parameter>
     1159    </synopsis>
     1160  </refsynopsisdiv>
     1161
     1162
     1163  <refsect1><title>Description</title>
     1164  <para>
     1165    Decodes the octets in <varname>vector</varname> (or the subsequence
     1166    of it delimited by <varname>start</varname> and
     1167    <varname>end</varname>) into a string according
     1168    to <varname>external-format</varname>.
     1169  </para>
     1170  <para>
     1171    If <varname>string</varname> is supplied, output will be written into it.
     1172    It must be large enough to hold the decoded characters.  If <varname>
     1173    string</varname> is not supplied, a new string will be allocated to
     1174    hold the decoded characters.
     1175  </para>
     1176  <para>
     1177    Returns, as multiple values, the decoded string and the position in
     1178    <varname>vector</varname> where the decoding ended.
     1179  </para>
     1180  </refsect1>
     1181</refentry>
     1182
     1183<refentry id="encode-string-to-octets">
     1184  <indexterm zone="encode-string-to-octets">
     1185    <primary>encode-string-to-octets</primary>
     1186  </indexterm>
     1187
     1188  <refnamediv>
     1189    <refname>encode-string-to-octets</refname>
     1190    <refpurpose></refpurpose>
     1191    <refclass>Function</refclass>
     1192  </refnamediv>
     1193
     1194  <refsynopsisdiv>
     1195    <synopsis>
     1196        <function>encode-string-to-octets</function>
     1197        <parameter>string</parameter>
     1198        <parameter>&key;</parameter>
     1199        <parameter>start</parameter>
     1200        <parameter>end</parameter>
     1201        <parameter>external-format</parameter>
     1202        <parameter>use-byte-order-mark</parameter>
     1203        <parameter>vector</parameter>
     1204        <parameter>vector-offset</parameter>
     1205    </synopsis>
     1206  </refsynopsisdiv>
     1207
     1208
     1209  <refsect1><title>Description</title>
     1210  <para>
     1211    Encodes <varname>string</varname> (or the substring delimited by
     1212    <varname>start</varname> and <varname>end</varname>)
     1213    into <varname>external-format</varname> and returns, as multiple
     1214    values, a vector of octets containing the encoded data and an integer
     1215    that specifies the offset into the vector where the encoded data ends.
     1216  </para>
     1217  <para>
     1218    When <varname>use-byte-order-mark</varname> is true, a byte-order mark
     1219    will be included in the encoded data.
     1220  </para>
     1221  <para>
     1222    If <varname>vector</varname> is supplied, output will be written
     1223    to it.  It must be of type (simple-array (unsigned-byte 8)) and be
     1224    large enough to hold the encoded data.  If it is not supplied, the function
     1225    will allocate a new vector.
     1226  </para>
     1227  <para>
     1228    If <varname>vector-offset</varname> is supplied, data will be written
     1229    into the output vector starting at that offset.
     1230  </para>
     1231  </refsect1>
     1232</refentry>
     1233
     1234<refentry id="string-size-in-octets">
     1235  <indexterm zone="string-size-in-octets">
     1236    <primary>string-size-in-octets</primary>
     1237  </indexterm>
     1238
     1239  <refnamediv>
     1240    <refname>string-size-in-octets</refname>
     1241    <refpurpose></refpurpose>
     1242    <refclass>Function</refclass>
     1243  </refnamediv>
     1244
     1245  <refsynopsisdiv>
     1246    <synopsis>
     1247        <function>string-size-in-octets</function>
     1248        <parameter>string</parameter>
     1249        <parameter>&key;</parameter>
     1250        <parameter>start</parameter>
     1251        <parameter>end</parameter>
     1252        <parameter>external-format</parameter>
     1253        <parameter>use-byte-order-mark</parameter>
     1254    </synopsis>
     1255  </refsynopsisdiv>
     1256
     1257
     1258  <refsect1><title>Description</title>
     1259  <para>
     1260    Returns the number of octets required to encode
     1261    <varname>string</varname> (or the substring delimited by
     1262    <varname>start</varname> and <varname>end</varname>) into
     1263    <varname>external-format</varname>.
     1264  </para>
     1265  <para>
     1266    When <varname>use-byte-order-mark</varname> is true, the returned
     1267    size will include space for a byte-order marker.
     1268  </para>
     1269  </refsect1>
     1270</refentry>
     1271
     1272 </sect3>
     1273
     1274
    11021275  </sect2>
    11031276
  • trunk/source/lib/ccl-export-syms.lisp

    r12336 r12368  
    665665     get-character-encoding
    666666     lookup-character-encoding
     667     string-size-in-octets
     668     encode-string-to-octets
     669     count-characters-in-octet-vector
     670     decode-string-from-octets
    667671     *terminal-character-encoding-name*
    668672     *default-file-character-encoding*
Note: See TracChangeset for help on using the changeset viewer.