data / flow_code /C /imageLib /Error.h
doanh25032004's picture
Add files using upload-large-folder tool
9913017 verified
Raw
History Blame Contribute Delete
1 kB
///////////////////////////////////////////////////////////////////////////
//
// NAME
// Error.h -- a simple error handling class
//
// DESCRIPTION
// The CError class is used to throw error messages back to the calling program.
//
// Copyright � Richard Szeliski, 2001.
// See Copyright.h for more details
//
///////////////////////////////////////////////////////////////////////////
namespace std {}
using namespace std;
#include <string.h>
#include <stdio.h>
#include <exception>
struct CError : public exception
{
CError(const char* msg) { strcpy(message, msg); }
CError(const char* fmt, int d) { sprintf(message, fmt, d); }
CError(const char* fmt, float f) { sprintf(message, fmt, f); }
CError(const char* fmt, const char *s) { sprintf(message, fmt, s); }
CError(const char* fmt, const char *s,
int d) { sprintf(message, fmt, s, d); }
char message[1024]; // longest allowable message
};