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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
// wmmixer - A mixer designed for WindowMaker
//
// Release 1.5
// Copyright (C) 1998 Sam Hawker <shawkie@geocities.com>
// Copyright (C) 2002 Gordon Fraser <gordon@debian.org>
// This software comes with ABSOLUTELY NO WARRANTY
// This software is free software, and you are welcome to redistribute it
// under certain conditions
// See the COPYING file for details.
#include "exception.h"
//--------------------------------------------------------------------
Exception::Exception()
{
error_message_ = NULL;
}
//--------------------------------------------------------------------
Exception::Exception(const Exception& exc)
{
char* other_message = exc.getErrorMessage();
if(other_message != NULL)
{
error_message_ = new char[strlen(other_message)+1];
strcpy(error_message_, other_message);
}
else
error_message_ = NULL;
}
//--------------------------------------------------------------------
Exception::~Exception()
{
if(error_message_ != NULL)
delete[] error_message_;
}
//--------------------------------------------------------------------
char* Exception::getErrorMessage() const
{
return error_message_;
}
//--------------------------------------------------------------------
MixerDeviceException::MixerDeviceException(char* device)
{
error_message_ = new char[256];
strcpy(error_message_, "Unable to open mixer device ");
strcat(error_message_, device);
}
|