2002-08-06 12:25:41 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
|
|
// by the OpenBeOS license.
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
/*!
|
|
|
|
\file sniffer/PatternList.h
|
|
|
|
MIME sniffer pattern list declarations
|
|
|
|
*/
|
2002-08-12 11:24:02 +04:00
|
|
|
#ifndef _SNIFFER_PATTERN_LIST_H
|
|
|
|
#define _SNIFFER_PATTERN_LIST_H
|
2002-08-06 12:25:41 +04:00
|
|
|
|
2002-08-10 13:36:00 +04:00
|
|
|
#include <sniffer/DisjList.h>
|
2002-08-06 12:25:41 +04:00
|
|
|
#include <sniffer/Range.h>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class BPositionIO;
|
|
|
|
|
2002-08-12 12:42:01 +04:00
|
|
|
namespace BPrivate {
|
|
|
|
namespace Storage {
|
2002-08-06 12:25:41 +04:00
|
|
|
namespace Sniffer {
|
|
|
|
|
|
|
|
class Err;
|
|
|
|
class Pattern;
|
|
|
|
|
2002-08-10 13:36:00 +04:00
|
|
|
/*! \brief A list of patterns, one of which must match for the list to match, all
|
|
|
|
of which are to be searched over the same range.
|
|
|
|
*/
|
|
|
|
class PatternList : public DisjList {
|
2002-08-06 12:25:41 +04:00
|
|
|
public:
|
|
|
|
PatternList(Range range);
|
|
|
|
virtual ~PatternList();
|
|
|
|
|
|
|
|
status_t InitCheck() const;
|
|
|
|
Err* GetErr() const;
|
|
|
|
|
|
|
|
virtual bool Sniff(BPositionIO *data) const;
|
2002-09-24 09:27:46 +04:00
|
|
|
virtual ssize_t BytesNeeded() const;
|
|
|
|
|
2002-08-06 12:25:41 +04:00
|
|
|
void Add(Pattern *pattern);
|
|
|
|
private:
|
|
|
|
std::vector<Pattern*> fList;
|
|
|
|
Range fRange;
|
|
|
|
};
|
|
|
|
|
2002-08-12 12:42:01 +04:00
|
|
|
}; // namespace Sniffer
|
|
|
|
}; // namespace Storage
|
|
|
|
}; // namespace BPrivate
|
|
|
|
|
|
|
|
#endif // _SNIFFER_PATTERN_LIST_H
|
|
|
|
|
2002-08-06 12:25:41 +04:00
|
|
|
|