File size: 1,001 Bytes
9913017 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ///////////////////////////////////////////////////////////////////////////
//
// 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
};
|