iRoCS Toolbox  1.1.0
CmdLineError.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2005-2015 Olaf Ronneberger, Jörg Mechnich, Florian Pigorsch,
4  * Mario Emmenlauer, Thorsten Schmidt
5  *
6  * Image Analysis Lab, University of Freiburg, Germany
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  **************************************************************************/
23 
24 /**************************************************************************
25 ** Title: basic exception
26 ** $RCSfile$
27 ** $Revision: 3319 $$Name$
28 ** $Date: 2010-01-23 17:10:43 +0100 (Sat, 23 Jan 2010) $
29 ** Copyright: GPL $Author: emmenlau $
30 ** Description:
31 **
32 **
33 **
34 **-------------------------------------------------------------------------
35 **
36 ** $Log$
37 ** Revision 1.2 2002/04/18 14:01:13 pigorsch
38 ** - added docu
39 **
40 ** Revision 1.1 2002/03/26 07:36:28 ronneber
41 ** restructuring for autoconf
42 **
43 ** Revision 1.1.1.1 2002/03/22 13:45:07 pigorsch
44 ** moved from polsoft repository
45 **
46 **
47 **
48 **************************************************************************/
49 
50 #ifndef CMDLINEERROR_HH
51 #define CMDLINEERROR_HH
52 
53 #ifdef HAVE_CONFIG_H
54 #include <config.hh>
55 #endif
56 
57 #include <sstream>
58 #include <string>
59 
60 /*======================================================================*/
69 /*======================================================================*/
71 {
72 public:
73  /*====================================================================*/
77  /*====================================================================*/
78  CmdLineError();
79 
80  /*====================================================================*/
86  /*====================================================================*/
87  CmdLineError(const CmdLineError& copy);
88 
89  /*====================================================================*/
93  /*====================================================================*/
94  virtual ~CmdLineError();
95 
96  /*====================================================================*/
104  /*====================================================================*/
105  template<typename T>
106  CmdLineError& operator<<(const T& data)
107  {
108  std::ostringstream oss;
109  oss << data;
110  pMessage+=oss.str();
111  return *this;
112  }
113 
114  /*====================================================================*/
120  /*====================================================================*/
121  const std::string
122  str() const
123  {
124  return pMessage;
125  }
126 
127 protected:
128  std::string pMessage;
129 };
130 
131 #endif
virtual ~CmdLineError()
Destructor.
The CmdLineError class is the parent class of all exceptions used in libCmdLine.
Definition: CmdLineError.hh:70
std::string pMessage
CmdLineError()
Constructor.
CmdLineError & operator<<(const T &data)
Add something to the error message.
const std::string str() const
Return error message.