class Zip::StringSource

Overview

Use string as a source for Archive#add or Archive#replace.

Example

# create a new string source
src = Zip::StringSource.new(zip, "test string")

# add to archive as "foo.txt"
zip.add("foo.txt", src)

Defined in:

zip/sources.cr

Constructors

Instance methods inherited from class Zip::Source

to_unsafe : LibZip::ZipSourceT to_unsafe

Constructor Detail

def self.new(zip : Archive, s : String) #

Create a new StringSource from the given string.

Example

# create a new string source
src = Zip::StringSource.new(zip, "test string")

# add to archive as "foo.txt"
zip.add("foo.txt", src)

[View source]