initial commit, lordsawar source, slightly modified
[lordsawar] / src / tarhelper.h
diff --git a/src/tarhelper.h b/src/tarhelper.h
new file mode 100644 (file)
index 0000000..3121e5e
--- /dev/null
@@ -0,0 +1,32 @@
+#include <libtar.h>
+#include <string>
+#include <iostream>
+#include <list>
+class Tar_Helper
+{
+public:
+
+    //! Constructor
+    Tar_Helper(std::string file, std::ios::openmode mode);
+
+    //! Destructor
+    ~Tar_Helper();
+
+    bool saveFile(std::string file, std::string destfile = "");
+
+    std::string getFile(std::string filename, bool &broken);
+
+    std::string getFirstFile(bool &broken);
+
+    std::list<std::string> getFilenamesWithExtension(std::string ext);
+
+    std::list<std::string> getFilenames();
+
+    void Close();
+private:
+
+    // DATA
+    TAR *t;
+    std::ios::openmode openmode;
+    std::string tmpoutdir;
+};