diff --git a/src/bincimapmime/address.cc b/src/bincimapmime/address.cc index f6140855..39200ed5 100644 --- a/src/bincimapmime/address.cc +++ b/src/bincimapmime/address.cc @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ +/* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * address.cc @@ -6,7 +6,7 @@ * Description: * Implementation of the Address class. * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 diff --git a/src/bincimapmime/address.h b/src/bincimapmime/address.h index 69f6db05..04cc8e21 100644 --- a/src/bincimapmime/address.h +++ b/src/bincimapmime/address.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ +/* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * src/mailbox/address.h @@ -6,7 +6,7 @@ * Description: * Declaration of the Address class. * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 diff --git a/src/bincimapmime/convert.cc b/src/bincimapmime/convert.cc index 438c4847..80738e80 100644 --- a/src/bincimapmime/convert.cc +++ b/src/bincimapmime/convert.cc @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ +/* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * convert.cc @@ -6,7 +6,7 @@ * Description: * Implementation of miscellaneous convertion functions. * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 diff --git a/src/bincimapmime/convert.h b/src/bincimapmime/convert.h index d69d7a99..9fa1b8fd 100644 --- a/src/bincimapmime/convert.h +++ b/src/bincimapmime/convert.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ +/* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * src/util/convert.h @@ -6,7 +6,7 @@ * Description: * Declaration of miscellaneous convertion functions. * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 @@ -38,7 +38,7 @@ #include #include "address.h" -#include "depot.h" +//#include "depot.h" namespace Binc { @@ -264,6 +264,9 @@ namespace Binc { } else if (*i == '*') regex += ".*?"; else if (*i == '%') { + regex += "(\\"; + regex += delimiter; + regex += "){0,1}"; regex += "[^\\"; regex += delimiter; regex += "]*?"; diff --git a/src/bincimapmime/depot.h b/src/bincimapmime/depot.h deleted file mode 100644 index e69de29b..00000000 diff --git a/src/bincimapmime/iodevice.cc b/src/bincimapmime/iodevice.cc index e17643b2..6561f0ca 100644 --- a/src/bincimapmime/iodevice.cc +++ b/src/bincimapmime/iodevice.cc @@ -41,7 +41,8 @@ IODevice::IODevice(int f) : flags(f | IsEnabled), maxOutputBufferSize(0), timeout(0), readCount(0), writeCount(0), - outputLevel(0), outputLevelLimit(0), + outputLevel(ErrorLevel), + outputLevelLimit(ErrorLevel), error(Unknown), errorString("Unknown error"), dumpfd(0) { @@ -161,25 +162,25 @@ unsigned int IODevice::getTimeout(void) const } //------------------------------------------------------------------------ -void IODevice::setOutputLevel(unsigned int level) +void IODevice::setOutputLevel(LogLevel level) { outputLevel = level; } //------------------------------------------------------------------------ -unsigned int IODevice::getOutputLevel(void) const +IODevice::LogLevel IODevice::getOutputLevel(void) const { return outputLevel; } //------------------------------------------------------------------------ -void IODevice::setOutputLevelLimit(unsigned int level) +void IODevice::setOutputLevelLimit(LogLevel level) { outputLevelLimit = level; } //------------------------------------------------------------------------ -unsigned int IODevice::getOutputLevelLimit(void) const +IODevice::LogLevel IODevice::getOutputLevelLimit(void) const { return outputLevelLimit; } diff --git a/src/bincimapmime/iodevice.h b/src/bincimapmime/iodevice.h index b48a43b9..a7bd0528 100644 --- a/src/bincimapmime/iodevice.h +++ b/src/bincimapmime/iodevice.h @@ -1,4 +1,4 @@ -/*-*-mode:c++-*-*/ +/*-*-mode:c++;c-basic-offset:2-*-*/ /* -------------------------------------------------------------------- * Filename: * src/iodevice.h @@ -151,6 +151,13 @@ namespace Binc { */ unsigned int getTimeout(void) const; + enum LogLevel { + ErrorLevel, + InfoLevel, + WarningLevel, + DebugLevel + }; + /*! Sets the output level for the following write operations on this device. @@ -172,14 +179,14 @@ namespace Binc { \param level The output level \sa getOutputLevel(), setOutputLevelLimit() */ - void setOutputLevel(unsigned int level); + void setOutputLevel(LogLevel level); /*! Returns the current output level. \sa setOutputLevel() */ - unsigned int getOutputLevel(void) const; + LogLevel getOutputLevel(void) const; /*! Sets the current output level limit. Write operations with a @@ -188,14 +195,14 @@ namespace Binc { \param level The output level limit \sa setOutputLevel() */ - void setOutputLevelLimit(unsigned int level); + void setOutputLevelLimit(LogLevel level); /*! Returns the current output level limit. \sa setOutputLevelLimit() */ - unsigned int getOutputLevelLimit(void) const; + LogLevel getOutputLevelLimit(void) const; /*! Returns the number of bytes that have been read from this device @@ -209,6 +216,11 @@ namespace Binc { */ unsigned int getWriteCount(void) const; + /*! + Calling this function enables the built-in protocol dumping feature in + the device. All input and output to this device will be dumped to a file + in /tmp. + */ void enableProtocolDumping(void); /*! @@ -356,11 +368,11 @@ namespace Binc { unsigned int readCount; unsigned int writeCount; - unsigned int outputLevel; - unsigned int outputLevelLimit; + LogLevel outputLevel; + LogLevel outputLevelLimit; - Error error; - std::string errorString; + mutable Error error; + mutable std::string errorString; int dumpfd; }; diff --git a/src/bincimapmime/iofactory.h b/src/bincimapmime/iofactory.h index 12f3164d..2c7b8157 100644 --- a/src/bincimapmime/iofactory.h +++ b/src/bincimapmime/iofactory.h @@ -28,8 +28,9 @@ #include #include +#include "iodevice.h" + namespace Binc { - class IODevice; class IOFactory { public: ~IOFactory(void); @@ -55,14 +56,14 @@ namespace Binc { #define bincDebug if (false) std::cout #else #define bincError \ - IOFactory::getLogger().setOutputLevel(0);IOFactory::getLogger() + IOFactory::getLogger().setOutputLevel(IODevice::ErrorLevel);IOFactory::getLogger() #define bincWarning \ - IOFactory::getLogger().setOutputLevel(2);IOFactory::getLogger() + IOFactory::getLogger().setOutputLevel(IODevice::WarningLevel);IOFactory::getLogger() #define bincDebug \ - IOFactory::getLogger().setOutputLevel(3);IOFactory::getLogger() + IOFactory::getLogger().setOutputLevel(IODevice::DebugLevel);IOFactory::getLogger() #endif #define bincInfo \ - IOFactory::getLogger().setOutputLevel(1);IOFactory::getLogger() + IOFactory::getLogger().setOutputLevel(IODevice::InfoLevel);IOFactory::getLogger() #endif diff --git a/src/bincimapmime/mime-getpart.cc b/src/bincimapmime/mime-getpart.cc index bde43ca9..a6869352 100644 --- a/src/bincimapmime/mime-getpart.cc +++ b/src/bincimapmime/mime-getpart.cc @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ +/* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * mime-getpart.cc @@ -6,7 +6,7 @@ * Description: * Implementation of main mime parser components * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 diff --git a/src/bincimapmime/mime-inputsource.h b/src/bincimapmime/mime-inputsource.h index 3b070805..ce434142 100644 --- a/src/bincimapmime/mime-inputsource.h +++ b/src/bincimapmime/mime-inputsource.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ +/* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * src/mime-inputsource.h @@ -6,7 +6,7 @@ * Description: * The base class of the MIME input source * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 @@ -211,9 +211,6 @@ namespace Binc { } } - - - extern Binc::MimeInputSource *mimeSource; #endif diff --git a/src/bincimapmime/mime-parsefull.cc b/src/bincimapmime/mime-parsefull.cc index 4f665533..816548f8 100644 --- a/src/bincimapmime/mime-parsefull.cc +++ b/src/bincimapmime/mime-parsefull.cc @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ + /* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * mime-parsefull.cc @@ -6,7 +6,7 @@ * Description: * Implementation of main mime parser components * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 diff --git a/src/bincimapmime/mime-parseonlyheader.cc b/src/bincimapmime/mime-parseonlyheader.cc index 8dddacf3..5b6b871f 100644 --- a/src/bincimapmime/mime-parseonlyheader.cc +++ b/src/bincimapmime/mime-parseonlyheader.cc @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ +/* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * mime-parseonlyheader.cc @@ -6,7 +6,7 @@ * Description: * Implementation of main mime parser components * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 diff --git a/src/bincimapmime/mime-printbody.cc b/src/bincimapmime/mime-printbody.cc index 3b70ae1b..66472bba 100644 --- a/src/bincimapmime/mime-printbody.cc +++ b/src/bincimapmime/mime-printbody.cc @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ +/* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * mime-printbody.cc @@ -6,7 +6,7 @@ * Description: * Implementation of main mime parser components * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 diff --git a/src/bincimapmime/mime-printdoc.cc b/src/bincimapmime/mime-printdoc.cc index 02a2c15f..998be7e4 100644 --- a/src/bincimapmime/mime-printdoc.cc +++ b/src/bincimapmime/mime-printdoc.cc @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ +/* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * mime-printdoc.cc @@ -6,7 +6,7 @@ * Description: * Implementation of main mime parser components * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 diff --git a/src/bincimapmime/mime-printheader.cc b/src/bincimapmime/mime-printheader.cc index 381b2c38..ac0b551d 100644 --- a/src/bincimapmime/mime-printheader.cc +++ b/src/bincimapmime/mime-printheader.cc @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ +/* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * mime-printheader.cc @@ -6,7 +6,7 @@ * Description: * Implementation of main mime parser components * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 diff --git a/src/bincimapmime/mime-utils.h b/src/bincimapmime/mime-utils.h index 0fa9c2b2..eec6bb09 100644 --- a/src/bincimapmime/mime-utils.h +++ b/src/bincimapmime/mime-utils.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ +/* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * mime.cc @@ -6,7 +6,7 @@ * Description: * Implementation of main mime parser components * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 diff --git a/src/bincimapmime/mime.cc b/src/bincimapmime/mime.cc index cd5ea5be..9ed7cde2 100644 --- a/src/bincimapmime/mime.cc +++ b/src/bincimapmime/mime.cc @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ +/* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * mime.cc @@ -6,7 +6,7 @@ * Description: * Implementation of main mime parser components * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 diff --git a/src/bincimapmime/mime.h b/src/bincimapmime/mime.h index 51a82793..df12227b 100644 --- a/src/bincimapmime/mime.h +++ b/src/bincimapmime/mime.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; -*- */ +/* -*- mode:c++;c-basic-offset:2 -*- */ /* -------------------------------------------------------------------- * Filename: * src/parsers/mime/mime.h @@ -6,7 +6,7 @@ * Description: * Declaration of main mime parser components * -------------------------------------------------------------------- - * Copyright 2002-2004 Andreas Aardal Hanssen + * Copyright 2002-2005 Andreas Aardal Hanssen * * 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 diff --git a/src/bincimapmime/session.h b/src/bincimapmime/session.h deleted file mode 100644 index e69de29b..00000000