From 1c158e2b570aac80eb744c482dd4f90b4a764b93 Mon Sep 17 00:00:00 2001 From: Florian Pose <fp@igh-essen.com> Date: Fri, 5 Mar 2010 13:20:42 +0100 Subject: [PATCH] Overloaded throwCommandException(). --- tool/Command.cpp | 7 +++++++ tool/Command.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/tool/Command.cpp b/tool/Command.cpp index c51ad312..82590d13 100644 --- a/tool/Command.cpp +++ b/tool/Command.cpp @@ -146,6 +146,13 @@ void Command::throwInvalidUsageException(const stringstream &s) const /*****************************************************************************/ +void Command::throwCommandException(const string &msg) const +{ + throw CommandException(msg); +} + +/*****************************************************************************/ + void Command::throwCommandException(const stringstream &s) const { throw CommandException(s); diff --git a/tool/Command.h b/tool/Command.h index 275cb8e3..a51aa171 100644 --- a/tool/Command.h +++ b/tool/Command.h @@ -62,6 +62,11 @@ class CommandException: friend class Command; protected: + /** Constructor with char * parameter. */ + CommandException( + const string &msg /**< Message. */ + ): runtime_error(msg) {} + /** Constructor with stringstream parameter. */ CommandException( const stringstream &s /**< Message. */ @@ -116,6 +121,7 @@ class Command enum {BreakAfterBytes = 16}; void throwInvalidUsageException(const stringstream &) const; + void throwCommandException(const string &) const; void throwCommandException(const stringstream &) const; void throwSingleSlaveRequired(unsigned int) const; -- GitLab