jigdo API
util/debug.hh File Reference
Debugging aids, including Error objects and assertions. More...
#include <config.h>
#include <algorithm>
#include <string>
Go to the source code of this file.
Namespaces | |
namespace | Debug |
Classes | |
struct | Error |
The messages are always in UTF-8! More... | |
struct | Cleanup |
Thrown to indicate: Don't report anything, but unwind stack and return specified value from main(). More... | |
Defines | |
#define | UNUSED_PARAM(_p) |
#define | DEBUG_ONLY_PARAM(_p) |
To avoid warnings if a function argument is only used by Paranoid(), i.e. | |
#define | Paranoid(expr) |
#define | Assert(_expr) |
#define | Message(_str) Debug::assertFail((_str), __FILE__, __LINE__) |
Functions | |
int | Debug::assertFail (const char *assertion, const char *file, unsigned int line) |
Print an "Assertion failed" message. | |
Variables | |
bool | Debug::abortAfterFailedAssertion = true |
True if to call abort() after failed assertion. |
Detailed Description
Debugging aids, including Error objects and assertions.The Error class is just a convenient base class for all kinds of errors which result in a text error message for printing to the user.
'Paranoid()' is only compiled in if DEBUG is defined. 'Assert()' is always compiled in.
General rule of thumb: 'Assert' is used to check things possibly passed from other modules, 'Paranoid' for consistency checks where only the current module changes the state. ('Module' = e.g. source file and accompanying header, but may be >1 source file if appropriate.)
Define Documentation
#define Assert | ( | _expr | ) |
Value:
((void) ((_expr) ? 0 : \ Debug::assertFail(#_expr, __FILE__, __LINE__)))
Referenced by IOSource< Job::MakeImageDl::IO >::addListener(), UrlMap::addPart(), ap(), append(), as(), bitWidth(), Job::CachedUrl::CachedUrl(), Job::MakeImageDl::childFor(), Download::cont(), expect(), expectEnum(), Gunzip::inject(), ConfigFile::iterator::isSection(), loggerInit(), main(), JigdoDesc::makeImage(), memData(), GtkSingleUrl::on_startButton_clicked(), Zobstream::open(), FilePart::SerializeCacheEntry::operator()(), Download::pause(), JobList::postGtkInit(), IList< Job::MakeImageDl::ChildListBase >::push_back(), IList< Job::MakeImageDl::ChildListBase >::push_front(), JigdoDescVec::put(), Zibstream::read(), Download::run(), MkTemplate::run(), Job::SingleUrl::run(), Job::MakeImageDl::run(), MessageBox::Ref::set(), JigdoCache::setParams(), Download::stop(), testBetween(), testFork(), testImageInfo(), testLoop(), testMinimal(), testNoMD5(), testSimple(), testUriJoin(), throwZerrorBz(), throwZerrorGz(), uriJoin(), Zobstream::write(), writeAll(), ZobstreamGz::zip2(), ZobstreamBz::zip2(), Download::~Download(), MessageBox::~MessageBox(), ZibstreamBz::~ZibstreamBz(), ZibstreamGz::~ZibstreamGz(), Zobstream::~Zobstream(), ZobstreamBz::~ZobstreamBz(), and ZobstreamGz::~ZobstreamGz().
#define DEBUG_ONLY_PARAM | ( | _p | ) |
To avoid warnings if a function argument is only used by Paranoid(), i.e.
only if DEBUG is defined
#define Message | ( | _str | ) | Debug::assertFail((_str), __FILE__, __LINE__) |
#define Paranoid | ( | expr | ) |
Referenced by UrlMap::addPart(), JobList::append(), Job::MakeImageDl::Child::Child(), Job::SingleUrl::cont(), deduceName2(), MD5Sum::digest(), ConfigFile::erase(), JobList::erase(), fileToImage(), CacheFile::find(), CacheFile::findName(), MD5Sum::finish(), MD5Sum::finishForReuse(), ConfigFile::get(), FilePart::getMD5Sum(), FilePart::getPath(), FilePart::getRsyncSum(), FilePart::getSums(), IListBase::iList_remove(), Job::MakeImageDl::imageInfo(), Gunzip::inject(), UrlMapping::insertNext(), FilePart::leafName(), JigdoDesc::makeImage(), JobList::makeRowBlank(), modAdd(), modSub(), FilePart::mtime(), GtkSingleUrl::on_startButton_clicked(), Zobstream::open(), MD5Sum::operator!=(), FilePart::SerializeCacheEntry::operator()(), MD5::operator=(), MD5Sum::operator==(), JigdoCache::iterator::operator==(), Job::SingleUrl::pause(), JobList::postGtkInit(), JobList::prepend(), ConfigFile::quote(), MkTemplate::run(), MD5Sum::serialize(), Progress::setAutoTick(), Job::MakeImageDl::setImageSection(), FilePart::size(), GtkSingleUrl::stop(), strSubst(), MD5Sum::update(), writeBuf(), Zobstream::writeZipped(), CacheFile::~CacheFile(), Job::MakeImageDl::Child::~Child(), GtkSingleUrl::~GtkSingleUrl(), and JigdoCache::~JigdoCache().
#define UNUSED_PARAM | ( | _p | ) |
Generated on Tue Sep 23 14:27:42 2008 for jigdo by
