sapling/hgext/extlib/cstore/match.h
Durham Goode 228e6a901e cstore: move to hgext/extlib/
Summary: Moves cstore to hgext/extlib/ and makes it build.

Test Plan: make local && run-tests.py

Reviewers: #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D6678852
2018-01-08 17:55:53 -08:00

37 lines
984 B
C++

// Copyright (c) 2004-present, Facebook, Inc.
// All Rights Reserved.
//
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2 or any later version.
// match.h - c++ declarations for a data store
// no-check-code
#ifndef FBHGEXT_CSTORE_MATCH_H
#define FBHGEXT_CSTORE_MATCH_H
class Matcher {
public:
virtual ~Matcher() {}
virtual bool matches(const std::string &path) = 0;
virtual bool matches(const char *path, const size_t pathlen) = 0;
virtual bool visitdir(const std::string &path) = 0;
};
class AlwaysMatcher : public Matcher {
public:
AlwaysMatcher() {}
~AlwaysMatcher() override {}
bool matches(const std::string& /*path*/) override {
return true;
}
bool matches(const char* /*path*/, const size_t /*pathlen*/) override {
return true;
}
bool visitdir(const std::string& /*path*/) override {
return true;
}
};
#endif // FBHGEXT_CSTORE_MATCH_H