walker.h
author Stiletto <blasux@blasux.ru>
Sat, 12 Feb 2011 13:45:55 +0300
changeset 0 56281d90869c
permissions -rw-r--r--
Initial commit

#ifndef _WALKER_H_INCLUDED_
#define _WALKER_H_INCLUDED_
#include <string>
#include <magic.h>

class MagicWalker {
    
    public:
        std::string root;
        MagicWalker(const std::string root);
        ~MagicWalker ();
        void Run() { HandleDir(root.c_str()); }
    protected:
        virtual int HandleFile(const char *filename);
        virtual int HandleDir(const char *dirname);
        const char *GetFileMagic(const char *filename);
        magic_t magic;
};

#endif