Treats a Zip File as a simple file system. More...
Public Types | |
|
typedef boost::shared_ptr < VirtualFS > | SharedPtr |
Public Member Functions | |
| VirtualFS () | |
| Default contructor. | |
| ~VirtualFS () | |
| Default Dtor. | |
| void | setArchive (const std::string &aZipFileName) |
| Set the archive to use. | |
| const std::string & | getArchive () const |
| Get the Archive in use. | |
| void | getArchiveMembers (std::vector< std::string > &a_arcMembers, const std::string &a_filter) |
| Get Archive Elements. | |
| void | readFile (const std::string &aFileName, std::ostringstream &a_out, uint32_bt &a_FileDataLen) |
| Read a file from the archive. | |
| void | readFileGZ (const std::string &aFileName, std::ostringstream &a_out, uint32_bt &a_FileDataLen) |
Treats a Zip File as a simple file system.
VirtualFS archive; try { archive.setArchive("resource.zip"); std::ostringstream data; uint32_bt len = 0; archive.readFile("test.css", data, len); m_cssData = data.str(); } catch(Poco::Exception& exc) { Poco::Logger::get(_LOGSUBSYSTEM_).error(exc.what()); } catch(...) { Poco::Logger::get(_LOGSUBSYSTEM_).error("Unknown Exception loading CSS"); }
| Tonido::Util::VirtualFS::VirtualFS | ( | ) |
Default contructor.
Just create object with no data
| void Tonido::Util::VirtualFS::getArchiveMembers | ( | std::vector< std::string > & | a_arcMembers, |
| const std::string & | a_filter | ||
| ) |
Get Archive Elements.
Get the member names in archive. If the file is present, then data will be stored in the list. Throws Exception on failure
| a_arcMembers - OUTPUT PARAM: members list in the archive |
| void Tonido::Util::VirtualFS::readFile | ( | const std::string & | aFileName, |
| std::ostringstream & | a_out, | ||
| uint32_bt & | a_FileDataLen | ||
| ) |
Read a file from the archive.
Read a file from the archive. If the file is present, then data will be stored in the FileData array and the FileDataLen will be updated to the size of the array Throws Exception on failure
| aFileName - Name of file to read from the archive | |
| a_out - OUTPUT PARAM: File data returned to user | |
| a_FileDataLen - OUTPUT PARAM: Length of the File |