Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

ExInfo.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net)
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  */
00009 #include "ExInfo.h"
00010 
00011 #include "StringTool.h"
00012 
00013 //-----------------------------------------------------------------
00014 /**
00015  * Info about problem.
00016  * @param problem short info
00017  */
00018     ExInfo::ExInfo(const std::string &problem) throw()
00019 : m_what(problem)
00020 {
00021     /* empty */
00022 }
00023 //-----------------------------------------------------------------
00024 /**
00025  * Return info about problem.
00026  * @return pointer to info which is valid only with this ExInfo
00027  */
00028     const char *
00029 ExInfo::what() const throw()
00030 {
00031     return m_what.c_str();
00032 }
00033 //-----------------------------------------------------------------
00034 /**
00035  * Add more info.
00036  * @param name description
00037  * @param value value
00038  * @return *this
00039  */
00040 ExInfo &
00041 ExInfo::addInfo(const std::string &name,
00042         const std::string &value) throw()
00043 {
00044     m_what.append("; ");
00045     m_what.append(name);
00046     m_what.append("='");
00047     m_what.append(value);
00048     m_what.append("'");
00049     return *this;
00050 }
00051 //-----------------------------------------------------------------
00052 /**
00053  * Add more info, numeric value.
00054  * @param name description
00055  * @param value value
00056  * @return *this
00057  */
00058     ExInfo &
00059 ExInfo::addInfo(const std::string &name, long value) throw()
00060 {
00061     m_what.append("; ");
00062     m_what.append(name);
00063     m_what.append("=");
00064     m_what.append(StringTool::toString(value));
00065     return *this;
00066 }
00067 

Generated on Wed Jun 1 09:54:30 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2