PHP 8.2.31
Preview: pack-i.yaml Size: 4.52 KB
//proc/thread-self/root/opt/alt/ruby18/share/ri/1.8/system/Array/pack-i.yaml

--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Packs the contents of <em>arr</em> into a binary sequence according to the directives in <em>aTemplateString</em> (see the table below) Directives ``A,'' ``a,'' and ``Z'' may be followed by a count, which gives the width of the resulting field. The remaining directives also may take a count, indicating the number of array elements to convert. If the count is an asterisk (``<tt>*</tt>''), all remaining array elements will be converted. Any of the directives ``<tt>sSiIlL</tt>'' may be followed by an underscore (``<tt>_</tt>'') to use the underlying platform's native size for the specified type; otherwise, they use a platform-independent size. Spaces are ignored in the template string. See also <tt>String#unpack</tt>.
- !ruby/struct:SM::Flow::VERB 
  body: "   a = [ &quot;a&quot;, &quot;b&quot;, &quot;c&quot; ]\n   n = [ 65, 66, 67 ]\n   a.pack(&quot;A3A3A3&quot;)   #=&gt; &quot;a  b  c  &quot;\n   a.pack(&quot;a3a3a3&quot;)   #=&gt; &quot;a\\000\\000b\\000\\000c\\000\\000&quot;\n   n.pack(&quot;ccc&quot;)      #=&gt; &quot;ABC&quot;\n"
- !ruby/struct:SM::Flow::P 
  body: Directives for <tt>pack</tt>.
- !ruby/struct:SM::Flow::VERB 
  body: " Integer   | Array   |\n Directive | Element | Meaning\n ------------------------------------------------------------------------\n    C      | Integer | 8-bit unsigned integer (unsigned char)\n    S      | Integer | 16-bit unsigned integer, native endian (uint16_t)\n    L      | Integer | 32-bit unsigned integer, native endian (uint32_t)\n    Q      | Integer | 64-bit unsigned integer, native endian (uint64_t)\n           |         |\n    c      | Integer | 8-bit signed integer (char)\n    s      | Integer | 16-bit signed integer, native endian (int16_t)\n    l      | Integer | 32-bit signed integer, native endian (int32_t)\n    q      | Integer | 64-bit signed integer, native endian (int64_t)\n           |         |\n    S_     | Integer | unsigned short, native endian\n    I, I_  | Integer | unsigned int, native endian\n    L_     | Integer | unsigned long, native endian\n           |         |\n    s_     | Integer | signed short, native endian\n    i, i_  | Integer | signed int, native endian\n    l_     | Integer | signed long, native endian\n           |         |\n    n      | Integer | 16-bit unsigned integer, network (big-endian) byte order\n    N      | Integer | 32-bit unsigned integer, network (big-endian) byte order\n    v      | Integer | 16-bit unsigned integer, VAX (little-endian) byte order\n    V      | Integer | 32-bit unsigned integer, VAX (little-endian) byte order\n           |         |\n    U      | Integer | UTF-8 character\n    w      | Integer | BER-compressed integer\n\n Float     |         |\n Directive |         | Meaning\n ------------------------------------------------------------------------\n    D, d   | Float   | double-precision float, native format\n    F, f   | Float   | single-precision float, native format\n    E      | Float   | double-precision float, little-endian byte order\n    e      | Float   | single-precision float, little-endian byte order\n    G      | Float   | double-precision float, network (big-endian) byte order\n    g      | Float   | single-precision float, network (big-endian) byte order\n\n String    |         |\n Directive |         | Meaning\n ------------------------------------------------------------------------\n    A      | String  | arbitrary binary string (space padded, count is width)\n    a      | String  | arbitrary binary string (null padded, count is width)\n    Z      | String  | same as ``a'', except that null is added with *\n    B      | String  | bit string (MSB first)\n    b      | String  | bit string (LSB first)\n    H      | String  | hex string (high nibble first)\n    h      | String  | hex string (low nibble first)\n    u      | String  | UU-encoded string\n    M      | String  | quoted printable, MIME encoding (see RFC2045)\n    m      | String  | base64 encoded string (see RFC 2045, count is width)\n    P      | String  | pointer to a structure (fixed-length string)\n    p      | String  | pointer to a null-terminated string\n\n Misc.     |         |\n Directive |         | Meaning\n ------------------------------------------------------------------------\n    @      | ---     | moves to absolute position\n    X      | ---     | back up a byte\n    x      | ---     | null byte\n"
full_name: Array#pack
is_singleton: false
name: pack
params: |
  arr.pack ( aTemplateString ) -> aBinaryString

visibility: public

Directory Contents

Dirs: 0 × Files: 95

Name Size Perms Modified Actions
582 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
433 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
527 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
566 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
1015 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
746 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
1.65 KB lrw-r--r-- 2023-07-26 13:47:04
Edit Download
367 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
1.47 KB lrw-r--r-- 2023-07-26 13:47:04
Edit Download
550 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
417 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
747 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
949 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
708 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
5.07 KB lrw-r--r-- 2023-07-26 13:47:04
Edit Download
269 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
421 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
704 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
784 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
1.11 KB lrw-r--r-- 2023-07-26 13:47:04
Edit Download
583 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
502 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
485 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
654 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
713 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
165 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
916 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
624 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
511 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
428 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
533 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
588 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
609 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
372 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
357 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
918 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
1.42 KB lrw-r--r-- 2023-07-26 13:47:04
Edit Download
843 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
694 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
749 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
898 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
326 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
360 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
585 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
833 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
341 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
341 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
712 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
604 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
276 B lrw-r--r-- 2023-07-26 13:47:04
Edit Download
561 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
502 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
407 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
696 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
776 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
1.19 KB lrw-r--r-- 2023-07-26 13:47:04
Edit Download
424 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
4.52 KB lrw-r--r-- 2023-07-26 13:47:05
Edit Download
1.33 KB lrw-r--r-- 2023-07-26 13:47:05
Edit Download
748 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
178 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
190 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
810 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
647 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
729 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
455 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
336 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
696 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
513 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
505 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
573 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
727 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
586 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
414 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
959 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
290 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
425 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
217 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
981 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
1.48 KB lrw-r--r-- 2023-07-26 13:47:05
Edit Download
903 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
939 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
391 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
503 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
322 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
248 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
397 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
178 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
443 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
632 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
485 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
604 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
620 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
193 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download
1019 B lrw-r--r-- 2023-07-26 13:47:05
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).