author | Stiletto <blasux@blasux.ru> |
Thu, 22 Sep 2011 13:27:23 +0400 | |
changeset 9 | ae87469781f2 |
parent 0 | 56281d90869c |
permissions | -rw-r--r-- |
0 | 1 |
#ifndef _WALKER_H_INCLUDED_ |
2 |
#define _WALKER_H_INCLUDED_ |
|
3 |
#include <string> |
|
4 |
#include <magic.h> |
|
5 |
||
6 |
class MagicWalker { |
|
7 |
|
|
8 |
public: |
|
9 |
std::string root; |
|
10 |
MagicWalker(const std::string root); |
|
11 |
~MagicWalker (); |
|
12 |
void Run() { HandleDir(root.c_str()); } |
|
13 |
protected: |
|
14 |
virtual int HandleFile(const char *filename); |
|
15 |
virtual int HandleDir(const char *dirname); |
|
16 |
const char *GetFileMagic(const char *filename); |
|
17 |
magic_t magic; |
|
18 |
}; |
|
19 |
||
20 |
#endif |