|
FreeNOS
|
Decompress a compressed file. More...
#include <Decompress.h>
Public Member Functions | |
| Decompress (int argc, char **argv) | |
| Constructor. More... | |
| virtual | ~Decompress () |
| Destructor. More... | |
| virtual Result | exec () |
| Execute the application. More... | |
Public Member Functions inherited from POSIXApplication | |
| POSIXApplication (int argc, char **argv) | |
| Class constructor. More... | |
| virtual | ~POSIXApplication () |
| Class destructor. More... | |
Public Member Functions inherited from Application | |
| Application (int argc, char **argv) | |
| Class constructor. More... | |
| virtual | ~Application () |
| Class destructor. More... | |
| virtual int | run () |
| Run the application. More... | |
Private Member Functions | |
| Result | decompressFile (const String inputFilename) const |
| Decompress the given file. More... | |
Additional Inherited Members | |
Public Types inherited from Application | |
| enum | Result { Success, NotFound, IOError, InvalidArgument, ShowUsage, TimedOut, OutOfMemory } |
| Result codes. More... | |
Protected Member Functions inherited from POSIXApplication | |
| virtual Result | output (const char *string) const |
| Print text to output. More... | |
| int | runProgram (const char *path, const char **argv) |
| Runs an external program. More... | |
Protected Member Functions inherited from Application | |
| virtual Result | initialize () |
| Initialize the application. More... | |
| virtual Result | output (String &string) const |
| Print string to output. More... | |
| ArgumentParser & | parser () |
| Get program arguments parser. More... | |
| const ArgumentParser & | parser () const |
| Get constant program arguments parser. More... | |
| const ArgumentContainer & | arguments () const |
| Get program arguments. More... | |
| void | setVersion (const String &version) |
| Set program version. More... | |
Protected Attributes inherited from Application | |
| int | m_argc |
| Input argument count. More... | |
| char ** | m_argv |
| Input argument values. More... | |
Decompress a compressed file.
Definition at line 31 of file Decompress.h.
| Decompress::Decompress | ( | int | argc, |
| char ** | argv | ||
| ) |
Constructor.
Definition at line 22 of file Decompress.cpp.
References Application::parser(), ArgumentParser::registerPositional(), and ArgumentParser::setDescription().
|
virtual |
Destructor.
Definition at line 29 of file Decompress.cpp.
|
private |
Decompress the given file.
| inputFilename | Path to the file to decompress |
Definition at line 54 of file Decompress.cpp.
References BufferedFile::buffer(), DEBUG, String::endsWith(), ERROR, Lz4Decompressor::getUncompressedSize(), Lz4Decompressor::initialize(), Application::InvalidArgument, Application::IOError, String::length(), POSIXApplication::output(), BufferedFile::path(), BufferedFile::read(), Lz4Decompressor::read(), BufferedFile::size(), String::substring(), BufferedFile::Success, Application::Success, and Lz4Decompressor::Success.
Referenced by exec().
|
virtual |
Execute the application.
Implements Application.
Definition at line 33 of file Decompress.cpp.
References Application::arguments(), Vector< T >::count(), decompressFile(), ArgumentContainer::getPositionals(), and Application::Success.
1.8.17