#ifndef NIGNORE_H #define NIGNORE_H #include "local_config.h" #ifdef CAN_USE_NIGNORE #include #include #include "ref.h" #include "leoini.h" #include class Node; class NIgnore { public: enum MatchType { MATCH_FALSE = 0, MATCH_TRUE, MATCH_REQUIRE_NEXT }; private: std::string name; std::vector dir; bool follow; bool is_valid; public: NIgnore( const std::string &name, Leo::Ini &ini ); MatchType match( Ref node, std::string & strip ); bool valid() const { return is_valid; } std::string getName() const { return name; } friend std::ostream & operator<<( std::ostream &out, Ref ni ); private: MatchType match_dir( Ref node, std::string & strip ); }; std::ostream & operator<<( std::ostream &out, Ref ni ); class NIgnoreChain { std::vector< Ref > nignores; public: NIgnoreChain() {} void add( Ref ni ) { nignores.push_back( ni ); } bool match( Ref node ); unsigned size() const { return nignores.size(); } bool empty() const { return nignores.size(); } std::string getName(); friend std::ostream & operator<<( std::ostream &out, Ref nc ); }; std::ostream & operator<<( std::ostream &out, Ref nc ); #endif #endif