1 //----------------------------------------------------------------------
2 // This software is part of the OpenBeOS distribution and is covered
4 //---------------------------------------------------------------------
7 Mime Sniffer Error class declarations
10 #define _SNIFFER_ERR_H
12 #include <SupportDefs.h>
19 //! Exception class used by the MIME Sniffer
20 /*! Each exception contains an error message, and an byte offset into
21 the original rule that generated the error, for the sake of
22 providing spiffy error messages of the following sort:
25 "1.0 ('abc' & 0xFFAAFFAA)"
26 ^ Sniffer pattern error: pattern and mask lengths do not match
31 Err(const char *msg
, const ssize_t pos
);
32 Err(const std::string
&msg
, const ssize_t pos
);
35 Err
& operator=(const Err
&ref
);
37 status_t
SetTo(const char *msg
, const ssize_t pos
);
38 status_t
SetTo(const std::string
&msg
, const ssize_t pos
);
41 void SetMsg(const char *msg
);
42 void SetPos(ssize_t pos
);
44 const char* Msg() const;
52 }; // namespace Sniffer
53 }; // namespace Storage
54 }; // namespace BPrivate
56 #endif // _SNIFFER_ERR_H