-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTCpio.h
61 lines (50 loc) · 2.28 KB
/
TCpio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/////////////////////////////////////////////////////////////////////////////
//TCpio.h
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "TArchive.h"
#include <string.h>
#ifndef _TCPIO_CLASS_H
#define _TCPIO_CLASS_H
#define CPIO_SIZE_FILD_SIGNATURE 6
#define CPIO_SIZE_FILD_DIGI_SIZE 8
class TCpio: public TArchive
{
private:
/*Zagolovok fayla v arhive
bez FILE_NAME*/
typedef struct __CPIO_FILE_HEAD
{
char FILD01[CPIO_SIZE_FILD_DIGI_SIZE];
char ATTR[CPIO_SIZE_FILD_DIGI_SIZE];
char FILD03[CPIO_SIZE_FILD_DIGI_SIZE];
char FILD04[CPIO_SIZE_FILD_DIGI_SIZE];
char TYPE[CPIO_SIZE_FILD_DIGI_SIZE];
char FILD06[CPIO_SIZE_FILD_DIGI_SIZE];
char FILE_SIZE[CPIO_SIZE_FILD_DIGI_SIZE];
char FILD08[CPIO_SIZE_FILD_DIGI_SIZE];
char FILD09[CPIO_SIZE_FILD_DIGI_SIZE];
char FILD10[CPIO_SIZE_FILD_DIGI_SIZE];
char FILD11[CPIO_SIZE_FILD_DIGI_SIZE];
char NAME_SIZE[CPIO_SIZE_FILD_DIGI_SIZE];
char FILD13[CPIO_SIZE_FILD_DIGI_SIZE];
} CPIO_FILE_HEAD;
//strukturi dlya chteniya arhiva
CPIO_FILE_HEAD m_FILE_HEAD; //zagolovok fayla
char m_SIGNATURE[CPIO_SIZE_FILD_SIGNATURE];
//vnutrennie funkcii
int AnalyzeFileHead(CPIO_FILE_HEAD&, int&); //obrabotka zagolovka fayla/papki
public:
TCpio(DataForArchive& dfa, LanguageMessages& langmsg, LanguageResults& langres, char* namearch = "CPIO"): TArchive(dfa, langmsg, langres, namearch) {;}
~TCpio() {;}
int TestFile (char*); //fayl yavlyaetsya arhivom CPIO
int AnalyzeInfoOfArc(char*); //opredelit' parametri (info) arhiva
ULONGLONG GetUnpackSizeFiles () {return m_UnpackSizeFiles;} //vozvrat real'nogo razmera faylov v BYTEs
ULONGLONG GetPackSizeFiles () {return m_PackSizeFiles;} //vozvrat sjatogo razmera faylov v BYTEs
ULONGLONG GetArchiveSize () {return m_ArchiveSize;} //vozvrat razmera arhiva v BYTEs
unsigned GetNumberFiles () {return m_NumberFiles;} //vozvrat kolichestvo faylov v arhive
unsigned GetNumberFolders () {return m_NumberFolders;} //vozvrat kolichestvo papok v arhive
double GetRatioArchiveSize () {return m_RatioArchiveSize;} //sjatie ot razmera arhiva (%)
double GetRatioPackFileSize() {return m_RatioPackFileSize;} //sjatie ot upak razmera faylov (%)
};
#endif //_TCPIO_CLASS_H