PHP 8.2.31
Preview: unpack-i.yaml Size: 7.83 KB
/proc/thread-self/root/opt/alt/ruby18/share/ri/1.8/system/String/unpack-i.yaml

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

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Decodes <em>str</em> (which may contain binary data) according to the format string, returning an array of each value extracted. The format string consists of a sequence of single-character directives, summarized in the table at the end of this entry. Each directive may be followed by a number, indicating the number of times to repeat with this directive. An asterisk (``<tt>*</tt>'') will use up all remaining elements. The directives <tt>sSiIlL</tt> may each be followed by an underscore (``<tt>_</tt>'') to use the underlying platform's native size for the specified type; otherwise, it uses a platform-independent consistent size. Spaces are ignored in the format string. See also <tt>Array#pack</tt>.
- !ruby/struct:SM::Flow::VERB 
  body: "   &quot;abc \\0\\0abc \\0\\0&quot;.unpack('A6Z6')   #=&gt; [&quot;abc&quot;, &quot;abc &quot;]\n   &quot;abc \\0\\0&quot;.unpack('a3a3')           #=&gt; [&quot;abc&quot;, &quot; \\000\\000&quot;]\n   &quot;abc \\0abc \\0&quot;.unpack('Z*Z*')       #=&gt; [&quot;abc &quot;, &quot;abc &quot;]\n   &quot;aa&quot;.unpack('b8B8')                 #=&gt; [&quot;10000110&quot;, &quot;01100001&quot;]\n   &quot;aaa&quot;.unpack('h2H2c')               #=&gt; [&quot;16&quot;, &quot;61&quot;, 97]\n   &quot;\\xfe\\xff\\xfe\\xff&quot;.unpack('sS')     #=&gt; [-2, 65534]\n   &quot;now=20is&quot;.unpack('M*')             #=&gt; [&quot;now is&quot;]\n   &quot;whole&quot;.unpack('xax2aX2aX1aX2a')    #=&gt; [&quot;h&quot;, &quot;e&quot;, &quot;l&quot;, &quot;l&quot;, &quot;o&quot;]\n"
- !ruby/struct:SM::Flow::P 
  body: This table summarizes the various formats and the Ruby classes returned by each.
- !ruby/struct:SM::Flow::VERB 
  body: "   Format | Returns | Function\n   -------+---------+-----------------------------------------\n     A    | String  | with trailing nulls and spaces removed\n   -------+---------+-----------------------------------------\n     a    | String  | string\n   -------+---------+-----------------------------------------\n     B    | String  | extract bits from each character (msb first)\n   -------+---------+-----------------------------------------\n     b    | String  | extract bits from each character (lsb first)\n   -------+---------+-----------------------------------------\n     C    | Fixnum  | extract a character as an unsigned integer\n   -------+---------+-----------------------------------------\n     c    | Fixnum  | extract a character as an integer\n   -------+---------+-----------------------------------------\n     d,D  | Float   | treat sizeof(double) characters as\n          |         | a native double\n   -------+---------+-----------------------------------------\n     E    | Float   | treat sizeof(double) characters as\n          |         | a double in little-endian byte order\n   -------+---------+-----------------------------------------\n     e    | Float   | treat sizeof(float) characters as\n          |         | a float in little-endian byte order\n   -------+---------+-----------------------------------------\n     f,F  | Float   | treat sizeof(float) characters as\n          |         | a native float\n   -------+---------+-----------------------------------------\n     G    | Float   | treat sizeof(double) characters as\n          |         | a double in network byte order\n   -------+---------+-----------------------------------------\n     g    | Float   | treat sizeof(float) characters as a\n          |         | float in network byte order\n   -------+---------+-----------------------------------------\n     H    | String  | extract hex nibbles from each character\n          |         | (most significant first)\n   -------+---------+-----------------------------------------\n     h    | String  | extract hex nibbles from each character\n          |         | (least significant first)\n   -------+---------+-----------------------------------------\n     I    | Integer | treat sizeof(int) (modified by _)\n          |         | successive characters as an unsigned\n          |         | native integer\n   -------+---------+-----------------------------------------\n     i    | Integer | treat sizeof(int) (modified by _)\n          |         | successive characters as a signed\n          |         | native integer\n   -------+---------+-----------------------------------------\n     L    | Integer | treat four (modified by _) successive\n          |         | characters as an unsigned native\n          |         | long integer\n   -------+---------+-----------------------------------------\n     l    | Integer | treat four (modified by _) successive\n          |         | characters as a signed native\n          |         | long integer\n   -------+---------+-----------------------------------------\n     M    | String  | quoted-printable\n   -------+---------+-----------------------------------------\n     m    | String  | base64-encoded\n   -------+---------+-----------------------------------------\n     N    | Integer | treat four characters as an unsigned\n          |         | long in network byte order\n   -------+---------+-----------------------------------------\n     n    | Fixnum  | treat two characters as an unsigned\n          |         | short in network byte order\n   -------+---------+-----------------------------------------\n     P    | String  | treat sizeof(char *) characters as a\n          |         | pointer, and  return \\emph{len} characters\n          |         | from the referenced location\n   -------+---------+-----------------------------------------\n     p    | String  | treat sizeof(char *) characters as a\n          |         | pointer to a  null-terminated string\n   -------+---------+-----------------------------------------\n     Q    | Integer | treat 8 characters as an unsigned\n          |         | quad word (64 bits)\n   -------+---------+-----------------------------------------\n     q    | Integer | treat 8 characters as a signed\n          |         | quad word (64 bits)\n   -------+---------+-----------------------------------------\n     S    | Fixnum  | treat two (different if _ used)\n          |         | successive characters as an unsigned\n          |         | short in native byte order\n   -------+---------+-----------------------------------------\n     s    | Fixnum  | Treat two (different if _ used)\n          |         | successive characters as a signed short\n          |         | in native byte order\n   -------+---------+-----------------------------------------\n     U    | Integer | UTF-8 characters as unsigned integers\n   -------+---------+-----------------------------------------\n     u    | String  | UU-encoded\n   -------+---------+-----------------------------------------\n     V    | Fixnum  | treat four characters as an unsigned\n          |         | long in little-endian byte order\n   -------+---------+-----------------------------------------\n     v    | Fixnum  | treat two characters as an unsigned\n          |         | short in little-endian byte order\n   -------+---------+-----------------------------------------\n     w    | Integer | BER-compressed integer (see Array.pack)\n   -------+---------+-----------------------------------------\n     X    | ---     | skip backward one character\n   -------+---------+-----------------------------------------\n     x    | ---     | skip forward one character\n   -------+---------+-----------------------------------------\n     Z    | String  | with trailing nulls removed\n          |         | upto first null with *\n   -------+---------+-----------------------------------------\n     @    | ---     | skip to the offset given by the\n          |         | length argument\n   -------+---------+-----------------------------------------\n"
full_name: String#unpack
is_singleton: false
name: unpack
params: |
  str.unpack(format)   => anArray

visibility: public

Directory Contents

Dirs: 0 × Files: 122

Name Size Perms Modified Actions
413 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
448 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
665 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
1.39 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
398 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
690 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
1.21 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
2.37 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
751 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
208 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
506 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
268 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
581 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
577 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
594 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
8.30 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
726 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
540 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
387 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
1.05 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
164 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
162 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
671 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
796 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
467 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
171 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
793 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
328 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
519 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
360 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
1.20 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
520 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
513 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
1.21 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
423 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
174 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
311 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
298 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
191 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
447 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
1.79 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
277 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
613 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
585 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
955 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
521 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
888 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
444 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
880 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
383 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
389 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
385 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
184 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
186 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
169 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
209 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
221 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
543 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
264 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
642 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
739 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
538 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
515 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
638 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
168 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
293 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
314 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
1.27 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
590 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
238 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
235 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
766 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
505 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
262 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
413 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
1010 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
740 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
739 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
539 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
516 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
1.53 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
171 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
366 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
366 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
260 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
1.09 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
2.37 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
2.83 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
177 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
898 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
319 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
344 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
475 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
446 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
1.69 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
364 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
162 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
527 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
381 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
553 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
449 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
454 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
455 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
451 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
457 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
701 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
1.02 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
264 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
268 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
880 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
179 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
381 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
948 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
378 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
170 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
7.83 KB lrw-r--r-- 2023-07-26 13:47:13
Edit Download
320 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
511 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
936 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
187 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
178 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download
182 B lrw-r--r-- 2023-07-26 13:47:13
Edit Download

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