Switchboard SDK
|
Public Member Functions | |
ZipFile (const std::string &path, bool read=true) | |
bool | add (const std::string &path, const std::string &name) |
bool | add (const std::vector< uint8 > &data, const std::string &name) |
bool | addFile (const std::string &name, const std::string &contents) |
bool | save () |
std::pair< bool, std::string > | test () |
bool | hasFile (const std::string &name) const |
std::vector< uint8 > | getFile (const std::string &name) const |
int | getNumFiles () const |
switchboard::audio::ZipFile::ZipFile | ( | const std::string & | path, |
bool | read = true ) |
The class constructor.
path | Destination of the zip file. |
bool switchboard::audio::ZipFile::add | ( | const std::string & | path, |
const std::string & | name ) |
Adds existing file to the zip.
path | Path fo the file to add. |
name | Name to appear in the zip file. |
bool switchboard::audio::ZipFile::add | ( | const std::vector< uint8 > & | data, |
const std::string & | name ) |
Adds binary data to the zip.
data | The Binary Data to add to the zip file. |
name | Name to appear in the zip file. |
bool switchboard::audio::ZipFile::addFile | ( | const std::string & | name, |
const std::string & | contents ) |
Adds text file to the zip.
name | Name to appear in the zip file. |
contents | Contents of the file. |
std::vector< uint8 > switchboard::audio::ZipFile::getFile | ( | const std::string & | name | ) | const |
Return contents of a file in the zip.
name | Name of file. |
int switchboard::audio::ZipFile::getNumFiles | ( | ) | const |
Get number of files in the zip.
bool switchboard::audio::ZipFile::hasFile | ( | const std::string & | name | ) | const |
Check if a file exists in the zip.
name | Name of file. |
bool switchboard::audio::ZipFile::save | ( | void | ) |
Save the zip file.
std::pair< bool, std::string > switchboard::audio::ZipFile::test | ( | ) |
Test the zip file.