/usr/include/facter/facts/external/resolver.hpp is in facter-dev 3.10.0-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | /**
* @file
* Declares the base external fact resolver.
*/
#pragma once
#include <stdexcept>
#include <string>
#include "../../export.h"
namespace facter { namespace facts {
struct collection;
}} // namespace facter::facts
namespace facter { namespace facts { namespace external {
/**
* Thrown when there is an error processing an external fact.
*/
struct LIBFACTER_EXPORT external_fact_exception : std::runtime_error
{
/**
* Constructs a external_fact_exception.
* @param message The exception message.
*/
explicit external_fact_exception(std::string const& message);
};
/**
* Base class for external resolvers
*/
struct LIBFACTER_EXPORT resolver
{
/**
* Determines if the resolver can resolve the facts from the given file.
* @param path The path to the file to resolve facts from.
* @return Returns true if the resolver can resolve the facts in the given file or false if it cannot.
*/
virtual bool can_resolve(std::string const& path) const = 0;
/**
* Resolves facts from the given file.
* @param path The path to the file to resolve facts from.
* @param facts The fact collection to populate the external facts into.
*/
virtual void resolve(std::string const& path, collection& facts) const = 0;
};
}}} // namespace facter::facts::external
|