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/RPattern.h
|
|
|
|
Mime Sniffer RPattern declarations
|
|
|
|
*/
|
2002-08-12 11:24:02 +04:00
|
|
|
#ifndef _SNIFFER_R_PATTERN_H
|
|
|
|
#define _SNIFFER_R_PATTERN_H
|
2002-08-06 12:25:41 +04:00
|
|
|
|
|
|
|
#include <sniffer/Range.h>
|
|
|
|
|
|
|
|
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-08 11:20:47 +04:00
|
|
|
//! A Pattern and a Range, bundled into one.
|
2002-08-06 12:25:41 +04:00
|
|
|
class RPattern {
|
|
|
|
public:
|
|
|
|
RPattern(Range range, Pattern *pattern);
|
|
|
|
~RPattern();
|
|
|
|
|
|
|
|
status_t InitCheck() const;
|
|
|
|
Err* GetErr() const;
|
|
|
|
|
2002-08-10 13:36:00 +04:00
|
|
|
bool Sniff(BPositionIO *data, bool caseInsensitive) const;
|
2002-09-24 09:27:46 +04:00
|
|
|
ssize_t BytesNeeded() const;
|
2002-08-06 12:25:41 +04:00
|
|
|
private:
|
|
|
|
Range fRange;
|
|
|
|
Pattern *fPattern;
|
|
|
|
};
|
|
|
|
|
2002-08-12 12:42:01 +04:00
|
|
|
}; // namespace Sniffer
|
|
|
|
}; // namespace Storage
|
|
|
|
}; // namespace BPrivate
|
|
|
|
|
|
|
|
#endif // _SNIFFER_R_PATTERN_H
|
|
|
|
|
2002-08-06 12:25:41 +04:00
|
|
|
|