X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/c4ba7c44ff03d67ff982bbab26dc48d796041e02..032bd56ff86166fd4b6a8f69bd9d5d1bc57b886e:/apt-pkg/contrib/error.h?ds=inline diff --git a/apt-pkg/contrib/error.h b/apt-pkg/contrib/error.h index 73735162d..21c51c1be 100644 --- a/apt-pkg/contrib/error.h +++ b/apt-pkg/contrib/error.h @@ -114,6 +114,15 @@ public: /*{{{*/ */ bool DebugE(const char *Function,const char *Description,...) __like_printf(3) __cold; + /** \brief adds an errno message with the given type + * + * \param type of the error message + * \param Function which failed + * \param Description of the error + */ + bool InsertErrno(MsgType const &type, const char* Function, + const char* Description,...) __like_printf(4) __cold; + /** \brief add an fatal error message to the list * * Most of the stuff we consider as "error" is also "fatal" for @@ -169,6 +178,13 @@ public: /*{{{*/ */ bool Debug(const char *Description,...) __like_printf(2) __cold; + /** \brief adds an error message with the given type + * + * \param type of the error message + * \param Description of the error + */ + bool Insert(MsgType const &type, const char* Description,...) __like_printf(3) __cold; + /** \brief is an error in the list? * * \return \b true if an error is included in the list, \b false otherwise @@ -204,9 +220,10 @@ public: /*{{{*/ * displayed or not. * * \param[out] out output stream to write the messages in - * \param WithoutNotice output notices or not + * \param threshold minimim level considered + * \param mergeStack */ - void DumpErrors(std::ostream &out, MsgType const &trashhold = WARNING, + void DumpErrors(std::ostream &out, MsgType const &threshold = WARNING, bool const &mergeStack = true); /** \brief dumps the list of messages to std::cerr @@ -214,10 +231,22 @@ public: /*{{{*/ * Note that all messages are discarded, also the notices * displayed or not. * - * \param WithoutNotice print notices or not + * \param threshold minimum level printed + */ + void inline DumpErrors(MsgType const &threshold) { + DumpErrors(std::cerr, threshold); + } + + // mvo: we do this instead of using a default parameter in the + // previous declaration to avoid a (subtle) API break for + // e.g. sigc++ and mem_fun0 + /** \brief dumps the messages of type WARNING or higher to std::cerr + * + * Note that all messages are discarded, displayed or not. + * */ - void inline DumpErrors(MsgType const &trashhold = WARNING) { - DumpErrors(std::cerr, trashhold); + void inline DumpErrors() { + DumpErrors(WARNING); } /** \brief put the current Messages into the stack @@ -278,9 +307,10 @@ private: /*{{{*/ std::list Stacks; bool InsertErrno(MsgType type, const char* Function, - const char* Description, va_list const &args); + const char* Description, va_list &args, + int const errsv, size_t &msgSize); bool Insert(MsgType type, const char* Description, - va_list const &args); + va_list &args, size_t &msgSize); /*}}}*/ }; /*}}}*/