mirror of
https://gitea.home.endeavr.de/Marcel/Tarstats-pp.git
synced 2025-12-10 00:39:01 +01:00
this cleaned up functions and global constants and hid them away in to their header and source files
This commit is contained in:
26
tarfunc.h
Normal file
26
tarfunc.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/* this header file contains function declarations used parsing a tar file
|
||||
*
|
||||
* by Marcel Nowicki (github@epenis.de | github.com/blindi0815)
|
||||
*/
|
||||
|
||||
#include <fstream>
|
||||
|
||||
|
||||
#ifndef TARSTATS___TARFUNC_H
|
||||
#define TARSTATS___TARFUNC_H
|
||||
namespace tar {
|
||||
// checks if a valid modern tar file - ustar
|
||||
bool validTar(std::istream &file);
|
||||
|
||||
// checks if a 512byte block consist only of 0 or \0
|
||||
bool eof(const char *buf);
|
||||
|
||||
// gets size of an item in bytes. assumes octal encoding.
|
||||
uint64_t getitemsize(const char *buf);
|
||||
|
||||
// gets type of an item
|
||||
std::string getitemtype(char &n);
|
||||
}
|
||||
|
||||
|
||||
#endif //TARSTATS___TARFUNC_H
|
||||
Reference in New Issue
Block a user