mirror of
https://review.haiku-os.org/haiku
synced 2025-01-21 22:04:49 +01:00
0bc621d53b
+ Now verifies the given priority is valid git-svn-id: file:///srv/svn/repos/haiku/trunk/current@649 a95241bf-73f2-0310-859d-f6bbb57e9c96
45 lines
900 B
C++
45 lines
900 B
C++
//----------------------------------------------------------------------
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
// by the OpenBeOS license.
|
|
//---------------------------------------------------------------------
|
|
/*!
|
|
\file sniffer/Rule.h
|
|
Mime sniffer rule declarations
|
|
*/
|
|
#ifndef _sk_sniffer_rule_h_
|
|
#define _sk_sniffer_rule_h_
|
|
|
|
#include <SupportDefs.h>
|
|
#include <vector>
|
|
|
|
class BPositionIO;
|
|
|
|
namespace Sniffer {
|
|
|
|
class Expr;
|
|
|
|
/*! \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;
|
|
private:
|
|
friend class Parser;
|
|
|
|
void Unset();
|
|
void SetTo(double priority, std::vector<Expr*>* list);
|
|
|
|
double fPriority;
|
|
std::vector<Expr*> *fExprList;
|
|
};
|
|
|
|
}
|
|
|
|
#endif // _sk_sniffer_rule_h_
|