2008-09-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Fixed compile error on OptionHandlerException
	* src/Makefile.am
	* src/OptionHandlerException.cc
	* src/OptionHandlerException.h
pull/1/head
Tatsuhiro Tsujikawa 2008-09-27 04:47:26 +00:00
parent e51e7207cf
commit 327cbcb1eb
4 changed files with 97 additions and 37 deletions

View File

@ -192,7 +192,7 @@ SRCS = Socket.h\
NsCookieParser.cc NsCookieParser.h\
CookieStorage.cc CookieStorage.h\
SocketBuffer.cc SocketBuffer.h\
OptionHandlerException.h
OptionHandlerException.cc OptionHandlerException.h
if HAVE_LIBZ
SRCS += GZipDecoder.cc GZipDecoder.h

View File

@ -413,10 +413,11 @@ am__libaria2c_a_SOURCES_DIST = Socket.h SocketCore.cc SocketCore.h \
InOrderURISelector.h ServerStatURISelector.cc \
ServerStatURISelector.h NsCookieParser.cc NsCookieParser.h \
CookieStorage.cc CookieStorage.h SocketBuffer.cc \
SocketBuffer.h OptionHandlerException.h GZipDecoder.cc \
GZipDecoder.h Sqlite3MozCookieParser.cc \
Sqlite3MozCookieParser.h AsyncNameResolver.cc \
AsyncNameResolver.h IteratableChunkChecksumValidator.cc \
SocketBuffer.h OptionHandlerException.cc \
OptionHandlerException.h GZipDecoder.cc GZipDecoder.h \
Sqlite3MozCookieParser.cc Sqlite3MozCookieParser.h \
AsyncNameResolver.cc AsyncNameResolver.h \
IteratableChunkChecksumValidator.cc \
IteratableChunkChecksumValidator.h \
IteratableChecksumValidator.cc IteratableChecksumValidator.h \
CheckIntegrityCommand.cc CheckIntegrityCommand.h \
@ -807,12 +808,13 @@ am__objects_18 = SocketCore.$(OBJEXT) Command.$(OBJEXT) \
ServerStatMan.$(OBJEXT) InOrderURISelector.$(OBJEXT) \
ServerStatURISelector.$(OBJEXT) NsCookieParser.$(OBJEXT) \
CookieStorage.$(OBJEXT) SocketBuffer.$(OBJEXT) \
$(am__objects_1) $(am__objects_2) $(am__objects_3) \
$(am__objects_4) $(am__objects_5) $(am__objects_6) \
$(am__objects_7) $(am__objects_8) $(am__objects_9) \
$(am__objects_10) $(am__objects_11) $(am__objects_12) \
$(am__objects_13) $(am__objects_14) $(am__objects_15) \
$(am__objects_16) $(am__objects_17)
OptionHandlerException.$(OBJEXT) $(am__objects_1) \
$(am__objects_2) $(am__objects_3) $(am__objects_4) \
$(am__objects_5) $(am__objects_6) $(am__objects_7) \
$(am__objects_8) $(am__objects_9) $(am__objects_10) \
$(am__objects_11) $(am__objects_12) $(am__objects_13) \
$(am__objects_14) $(am__objects_15) $(am__objects_16) \
$(am__objects_17)
am_libaria2c_a_OBJECTS = $(am__objects_18)
libaria2c_a_OBJECTS = $(am_libaria2c_a_OBJECTS)
am__installdirs = "$(DESTDIR)$(bindir)"
@ -1135,13 +1137,13 @@ SRCS = Socket.h SocketCore.cc SocketCore.h BinaryStream.h Command.cc \
InOrderURISelector.h ServerStatURISelector.cc \
ServerStatURISelector.h NsCookieParser.cc NsCookieParser.h \
CookieStorage.cc CookieStorage.h SocketBuffer.cc \
SocketBuffer.h OptionHandlerException.h $(am__append_1) \
$(am__append_2) $(am__append_3) $(am__append_4) \
$(am__append_5) $(am__append_6) $(am__append_7) \
$(am__append_8) $(am__append_9) $(am__append_10) \
$(am__append_11) $(am__append_12) $(am__append_13) \
$(am__append_14) $(am__append_15) $(am__append_16) \
$(am__append_17)
SocketBuffer.h OptionHandlerException.cc \
OptionHandlerException.h $(am__append_1) $(am__append_2) \
$(am__append_3) $(am__append_4) $(am__append_5) \
$(am__append_6) $(am__append_7) $(am__append_8) \
$(am__append_9) $(am__append_10) $(am__append_11) \
$(am__append_12) $(am__append_13) $(am__append_14) \
$(am__append_15) $(am__append_16) $(am__append_17)
noinst_LIBRARIES = libaria2c.a
libaria2c_a_SOURCES = $(SRCS)
aria2c_LDADD = libaria2c.a @LIBINTL@ @ALLOCA@ @LIBGNUTLS_LIBS@\
@ -1442,6 +1444,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OSMetalinkParserState.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Option.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OptionHandler.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OptionHandlerException.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OptionHandlerFactory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OptionParser.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PStringBuildVisitor.Po@am__quote@

View File

@ -0,0 +1,69 @@
/* <!-- copyright */
/*
* aria2 - The high speed download utility
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations
* including the two.
* You must obey the GNU General Public License in all respects
* for all of the code used other than OpenSSL. If you modify
* file(s) with this exception, you may extend this exception to your
* version of the file(s), but you are not obligated to do so. If you
* do not wish to do so, delete this exception statement from your
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*/
/* copyright --> */
#include "OptionHandlerException.h"
#include "StringFormat.h"
namespace aria2 {
const std::string OptionHandlerException::MESSAGE
("Exception occurred while processing option %s:");
OptionHandlerException::OptionHandlerException(const std::string& optName):
FatalException
(StringFormat(MESSAGE.c_str(), optName.c_str()).str()), _optName(optName) {}
OptionHandlerException::OptionHandlerException(const std::string& optName,
const Exception& cause):
FatalException
(StringFormat(MESSAGE.c_str(), optName.c_str()).str(), cause),
_optName(optName) {}
OptionHandlerException::OptionHandlerException(const OptionHandlerException& e):
FatalException(e), _optName(e._optName) {}
OptionHandlerException::~OptionHandlerException() throw() {}
const std::string& OptionHandlerException::getOptionName() const throw()
{
return _optName;
}
SharedHandle<Exception> OptionHandlerException::copy() const
{
SharedHandle<Exception> e(new OptionHandlerException(*this));
return e;
}
} // namespace aria2

View File

@ -35,7 +35,6 @@
#ifndef _D_OPTION_HANDLER_EXCEPTION_H_
#define _D_OPTION_HANDLER_EXCEPTION_H_
#include "FatalException.h"
#include "StringFormat.h"
namespace aria2 {
@ -43,30 +42,19 @@ class OptionHandlerException:public FatalException {
private:
std::string _optName;
static const std::string MESSAGE =
"Exception occurred while processing option %s:";
static const std::string MESSAGE;
protected:
virtual SharedHandle<Exception> copy() const
{
SharedHandle<Exception> e(new OptionHandlerException(*this));
return e;
}
virtual SharedHandle<Exception> copy() const;
public:
OptionHandlerException(const std::string& optName):
FatalException
(StringFormat(MESSAGE, optName.c_str()).str()), _optName(optName) {}
OptionHandlerException(const std::string& optName);
OptionHandlerException(const std::string& optName,
const Exception& cause):
FatalException
(StringFormat(MESSAGE, optName.c_str()).str(), cause), _optName(optName) {}
OptionHandlerException(const std::string& optName, const Exception& cause);
OptionHandlerException(const OptionHandlerException& e):
FatalException(e), _optName(e._optName) {}
OptionHandlerException(const OptionHandlerException& e);
virtual ~OptionHandlerException() throw() {}
virtual ~OptionHandlerException() throw();
const std::string& getOptionName() const throw() { return _optName; }
const std::string& getOptionName() const throw();
};
} // namespace aria2