walker.h
changeset 0 56281d90869c
equal deleted inserted replaced
-1:000000000000 0:56281d90869c
       
     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