09d84e61b6
+ Changed Sniffer namespace to BPrivate::Storage::Sniffer git-svn-id: file:///srv/svn/repos/haiku/trunk/current@714 a95241bf-73f2-0310-859d-f6bbb57e9c96
52 lines
1.0 KiB
C++
52 lines
1.0 KiB
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 _SNIFFER_RULE_H
|
|
#define _SNIFFER_RULE_H
|
|
|
|
#include <SupportDefs.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;
|
|
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
|
|
|
|
|