source: EcnlProtoTool/trunk/mruby-2.1.1/mrbgems/mruby-pack/README.md@ 439

Last change on this file since 439 was 439, checked in by coas-nagasima, 4 years ago

mrubyを2.1.1に更新

File size: 2.8 KB
Line 
1mruby-pack (pack / unpack)
2=========
3
4mruby-pack provides `Array#pack` and `String#unpack` for mruby.
5
6
7## Installation
8Add the line below into your `build_config.rb`:
9
10```
11 conf.gem :github => 'iij/mruby-pack'
12```
13
14There is no dependency on other mrbgems.
15
16
17## Supported template string
18 - A : arbitrary binary string (space padded, count is width)
19 - a : arbitrary binary string (null padded, count is width)
20 - C : 8-bit unsigned (unsigned char)
21 - c : 8-bit signed (signed char)
22 - D, d: 64-bit float, native format
23 - E : 64-bit float, little endian byte order
24 - e : 32-bit float, little endian byte order
25 - F, f: 32-bit float, native format
26 - G : 64-bit float, network (big-endian) byte order
27 - g : 32-bit float, network (big-endian) byte order
28 - H : hex string (high nibble first)
29 - h : hex string (low nibble first)
30 - I : unsigned integer, native endian (`unsigned int` in C)
31 - i : signed integer, native endian (`int` in C)
32 - L : 32-bit unsigned, native endian (`uint32_t`)
33 - l : 32-bit signed, native endian (`int32_t`)
34 - m : base64 encoded string (see RFC 2045, count is width)
35 - N : 32-bit unsigned, network (big-endian) byte order
36 - n : 16-bit unsigned, network (big-endian) byte order
37 - Q : 64-bit unsigned, native endian (`uint64_t`)
38 - q : 64-bit signed, native endian (`int64_t`)
39 - S : 16-bit unsigned, native endian (`uint16_t`)
40 - s : 16-bit signed, native endian (`int16_t`)
41 - U : UTF-8 character
42 - V : 32-bit unsigned, VAX (little-endian) byte order
43 - v : 16-bit unsigned, VAX (little-endian) byte order
44 - x : null byte
45 - Z : same as "a", except that null is added with *
46
47
48
49## License
50
51Copyright (c) 2012 Internet Initiative Japan Inc.
52Copyright (c) 2017 mruby developers
53
54Permission is hereby granted, free of charge, to any person obtaining a
55copy of this software and associated documentation files (the "Software"),
56to deal in the Software without restriction, including without limitation
57the rights to use, copy, modify, merge, publish, distribute, sublicense,
58and/or sell copies of the Software, and to permit persons to whom the
59Software is furnished to do so, subject to the following conditions:
60
61The above copyright notice and this permission notice shall be included in
62all copies or substantial portions of the Software.
63
64THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
66FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
67AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
68LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
69FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
70DEALINGS IN THE SOFTWARE.
71
Note: See TracBrowser for help on using the repository browser.