mirror of
https://review.haiku-os.org/haiku
synced 2025-01-20 13:31:28 +01:00
10db8711a8
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@648 a95241bf-73f2-0310-859d-f6bbb57e9c96
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
//----------------------------------------------------------------------
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
// by the OpenBeOS license.
|
|
//---------------------------------------------------------------------
|
|
/*!
|
|
\file sniffer/Err.h
|
|
Mime Sniffer Error class declarations
|
|
*/
|
|
#ifndef _sk_sniffer_err_h_
|
|
#define _sk_sniffer_err_h_
|
|
|
|
#include <SupportDefs.h>
|
|
#include <string>
|
|
|
|
namespace Sniffer {
|
|
|
|
//! Exception class used by the MIME Sniffer
|
|
/*! Each exception contains an error message, and an byte offset into
|
|
the original rule that generated the error, for the sake of
|
|
providing spiffy error messages of the following sort:
|
|
|
|
<code>
|
|
"1.0 ('abc' & 0xFFAAFFAA)"
|
|
^ Sniffer pattern error: pattern and mask lengths do not match
|
|
</code>
|
|
*/
|
|
class Err {
|
|
public:
|
|
Err(const char *msg, const ssize_t pos);
|
|
Err(const std::string &msg, const ssize_t pos);
|
|
Err(const Err &ref);
|
|
virtual ~Err();
|
|
Err& operator=(const Err &ref);
|
|
|
|
status_t SetTo(const char *msg, const ssize_t pos);
|
|
status_t SetTo(const std::string &msg, const ssize_t pos);
|
|
void Unset();
|
|
|
|
void SetMsg(const char *msg);
|
|
void SetPos(ssize_t pos);
|
|
|
|
const char* Msg() const;
|
|
ssize_t Pos() const;
|
|
|
|
private:
|
|
char *fMsg;
|
|
ssize_t fPos;
|
|
};
|
|
|
|
}
|
|
|
|
#endif // _sk_sniffer_err_h_
|