haiku/headers/private/storage/sniffer/Rule.h
Coldfirex 2ca1376080 Mass updating of OpenBeOS text to Haiku
No functional code altered.

https://dev.haiku-os.org/ticket/17197

Change-Id: I75cc74f6be0ad968fd77c31fbe5b0f650a6fe9e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4364
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-11-07 10:00:35 +00:00

54 lines
1.1 KiB
C++

//----------------------------------------------------------------------
// This software is part of the Haiku distribution and is covered
// by the MIT License.
//---------------------------------------------------------------------
/*!
\file sniffer/Rule.h
Mime sniffer rule declarations
*/
#ifndef _SNIFFER_RULE_H
#define _SNIFFER_RULE_H
#include <SupportDefs.h>
#include <sys/types.h>
#include <vector>
class BPositionIO;
namespace BPrivate {
namespace Storage {
namespace Sniffer {
class DisjList;
/*! \brief A priority and a list of expressions to be used for sniffing out the
type of an untyped file.
*/
class Rule {
public:
Rule();
~Rule();
status_t InitCheck() const;
double Priority() const;
bool Sniff(BPositionIO *data) const;
ssize_t BytesNeeded() const;
private:
friend class Parser;
void Unset();
void SetTo(double priority, std::vector<DisjList*>* list);
double fPriority;
std::vector<DisjList*> *fConjList; // A list of DisjLists to be ANDed
};
}; // namespace Sniffer
}; // namespace Storage
}; // namespace BPrivate
#endif // _SNIFFER_RULE_H