const store
XuAPI
pub const store = 0用途
公开常量 `store`。 值为 `0`
参数
无
API
#archive/zipzip Reader/Writer(Store 与 deflate)。无 ZIP64。
const storepub const store = 0公开常量 `store`。 值为 `0`
无
const deflatepub const deflate = 8公开常量 `deflate`。 值为 `8`
无
struct Filepub struct File {
pub name string
pub method int
pub crc32 int
pub compressed_size int
pub uncompressed_size int
pub body string
}公开结构体 `File`。
name stringmethod intcrc32 intcompressed_size intuncompressed_size intbody stringstruct Readerpub struct Reader {
pub data string
pub pos int
}公开结构体 `Reader`。
data stringpos intstruct Writerpub struct Writer {
pub buf string
pub names []string
pub methods []int
pub crcs []int
pub comps []int
pub uncomps []int
pub offsets []int
pub closed int
pub comment string
}公开结构体 `Writer`。
buf stringnames []stringmethods []intcrcs []intcomps []intuncomps []intoffsets []intclosed intcomment stringnew_readerpub fn new_reader(data &string) Reader构造 reader。
data &stringReader — 该类型的值
new_writerpub fn new_writer() Writer构造 writer。
无
Writer — 该类型的值
(&mut Writer) set_commentpub fn (w &mut Writer) set_comment(s string)`&mut Writer` 上的方法:设置 comment。
w &mut Writers string(&Writer) file_countpub fn (w &Writer) file_count() int`&Writer` 上的方法:文件计数。
w &Writerint — 该类型的值
commentpub fn comment(data &string) stringcomment,返回 string。失败时 throw。
data &stringstring — 结果字符串
(&Writer) bytespub fn (w &Writer) bytes() string`&Writer` 上的方法:返回已缓冲的字节串。
w &Writerstring — 结果字符串
(&mut Writer) write_filepub fn (w &mut Writer) write_file(name &string, body &string) int`&mut Writer` 上的方法:写入文件。
w &mut Writername &stringbody &stringint — 该类型的值
(&mut Writer) write_file_deflatepub fn (w &mut Writer) write_file_deflate(name &string, body &string) int`&mut Writer` 上的方法:写入文件deflate。
w &mut Writername &stringbody &stringint — 该类型的值
(&mut Writer) closepub fn (w &mut Writer) close() int`&mut Writer` 上的方法:关闭资源。失败时 throw。
w &mut Writerint — 该类型的值
(&mut Reader) nextpub fn (r &mut Reader) next() File`&mut Reader` 上的方法:取出下一项;没有则按本类型约定结束。失败时 throw。
r &mut ReaderFile — 该类型的值