Tyler Dauwalder 74cd43ec44 New mime sniffer support classes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@601 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-06 08:25:41 +00:00

43 lines
1.0 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
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();
const char* Msg() const;
ssize_t Pos() const;
private:
friend class Parser; // So it can update the pos of its out of mem object
void SetMsg(const char *msg);
void SetPos(ssize_t pos);
char *fMsg;
ssize_t fPos;
};
}
#endif // _sk_sniffer_err_h_