New update! 3.1 is liiiive!
Error handling: Array now has sufficiently advanced error handling to remove most, if not all, disable_checks. Extention: With the metaprogramming techniques, new types can be added easily. Speed: With the new changes I've made to Judy, the Array module has far exceeded the speed of any traditional datatype
This commit is contained in:
50
dlls/arrayx/JudyEx.h
Normal file
50
dlls/arrayx/JudyEx.h
Normal file
@ -0,0 +1,50 @@
|
||||
#ifndef _JUDYEX_INCLUDED
|
||||
#define _JUDYEX_INCLUDED
|
||||
|
||||
#include <exception>
|
||||
|
||||
class JudyEx
|
||||
{
|
||||
private:
|
||||
char* ex_message;
|
||||
bool fatal;
|
||||
|
||||
public:
|
||||
|
||||
JudyEx() { ex_message = NULL; fatal = true; }
|
||||
JudyEx(char* set, bool isfatal)
|
||||
{
|
||||
ex_message = new char[strlen(set) + 1];
|
||||
strcpy(ex_message, set);
|
||||
|
||||
fatal = isfatal;
|
||||
}
|
||||
|
||||
JudyEx(const JudyEx ©)
|
||||
{
|
||||
ex_message = new char[strlen(copy.ex_message) + 1];
|
||||
strcpy(ex_message, copy.ex_message);
|
||||
|
||||
fatal = copy.fatal;
|
||||
}
|
||||
|
||||
~JudyEx() { delete ex_message; }
|
||||
|
||||
void Destroy() { delete ex_message; }
|
||||
|
||||
void SetIsFatal(bool isfatal) { fatal = isfatal; }
|
||||
bool IsFatal( void ) { return fatal; }
|
||||
|
||||
char* SetErrorMessage(char* set)
|
||||
{
|
||||
ex_message = new char[strlen(set) + 1];
|
||||
strcpy(ex_message, set);
|
||||
}
|
||||
|
||||
char* ErrorMessage( void )
|
||||
{
|
||||
return ex_message;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user