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

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

ファイルを追加、更新。

File size: 2.6 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 - V : 32-bit unsigned, VAX (little-endian) byte order
42 - v : 16-bit unsigned, VAX (little-endian) byte order
43 - Z : same as "a", except that null is added with *
44
45
46## License
47
48Copyright (c) 2012 Internet Initiative Japan Inc.
49
50Permission is hereby granted, free of charge, to any person obtaining a
51copy of this software and associated documentation files (the "Software"),
52to deal in the Software without restriction, including without limitation
53the rights to use, copy, modify, merge, publish, distribute, sublicense,
54and/or sell copies of the Software, and to permit persons to whom the
55Software is furnished to do so, subject to the following conditions:
56
57The above copyright notice and this permission notice shall be included in
58all copies or substantial portions of the Software.
59
60THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
61IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
62FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
63AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
64LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
65FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
66DEALINGS IN THE SOFTWARE.
67
Note: See TracBrowser for help on using the repository browser.