A
download GrubExp.cpp
Language: C++
LOC: 43
Project Info
grub.org - Distributed Internet Crawler(grub)
Server: SourceForge
Type: cvs
...ge\g\grub\grub\client\util\
   alt_ftw.c
   alt_ftw.h
   bin_test_util.dsp
   clog.cpp
   clog.h
   ConfigFileInfo.h
   crc.h
   crc_32.c
   crc_32.cpp
   crc_32.h
   crc_test.c
   crc_test.cpp
   crc32.c
   crc32.h
   dbl_list.c
   dbl_list.h
   delay.cpp
   delay.h
   diagnose.h
   fc32.c
   file_data.c
   file_data.h
   getopt.c
   getopt.h
   grubconf.c
   grubconf.h
   GrubExp.cpp
   GrubExp.h
   Gui.cpp
   Gui.h
   intl.h
   lib_util.dsp
   lockfile.cpp
   lockfile.h
   Makefile.am
   parsecfg.c
   parsecfg.h
   platform.h
   rmfiles.c
   rmfiles.h
   ServerSettings.cpp
   ServerSettings.h
   sniptype.h
   StatusInterface.cpp
   StatusInterface.h
   strip_url.c
   strip_url.h
   test_util.cpp

#include "GrubExp.h"

using namespace std;

GrubExp::GrubExp() throw() : msg(0)
{
	copy("Archive database exception");
}

GrubExp::GrubExp( const char * str ) throw() : msg(0)
{
	copy( str );
}

GrubExp::GrubExp( const GrubExp& exp )
	throw() : exception( exp ), msg(0)
{
	copy( exp.msg );
}

GrubExp::~GrubExp() throw()
{
	if ( msg )
		delete [] msg;
}

const char *GrubExp::what() throw()
{
	return msg;
}

GrubExp& GrubExp::operator=( const GrubExp& exp )
	throw()
{
	if ( this != &exp ) {

		copy( exp.msg );
	}

	return *this;
}

// CLASS GrubExp - PRIVATE

void GrubExp::copy( const char * str )
{
	if ( msg ) {

		delete [] msg;
		msg = 0;
	}

	if ( str ) {

		msg = new char[strlen(str) + 1];
		strcpy( msg, str );
	}
}

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us