# ne7ssh_error.h

    00001 /***************************************************************************
    00002  *   Copyright (C) 2005-2007 by NetSieben Technologies INC                           *
    00003  *   Author: Andrew Useckas                                                *
    00004  *   Email: andrew@netsieben.com                                           *
    00005  *                                                                         *
    00006  *   This program may be distributed under the terms of the Q Public       *
    00007  *   License as defined by Trolltech AS of Norway and appearing in the     *
    00008  *   file LICENSE.QPL included in the packaging of this file.              *
    00009  *                                                                         *
    00010  *   This program is distributed in the hope that it will be useful,       *
    00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
    00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  *
    00013  ***************************************************************************/
    00014
    00015 #ifndef NE7SSH_ERROR_H
    00016 #define NE7SSH_ERROR_H
    00017
    00018 #include <stdlib.h>
    00019 #if !defined(WIN32) && !defined(__MINGW32__)
    00020 #   include <sys/select.h>
    00021 #endif
    00022
    00023 #define MAX_ERROR_LEN 500
    00024
    00025 #include "ne7ssh_types.h"
    00026 #include "ne7ssh_mutex.h"
    00027
    00031 class SSH_EXPORT Ne7sshError
    00032 {
    00033   private:
    00034     uint16 memberCount;
    00035     char popedErr[MAX_ERROR_LEN + 1];
    00036     static Ne7ssh_Mutex mut;
    00037
    00041     struct Error
    00042     {
    00043       int32 channel;
    00044       char* errorStr;
    00045     } **ErrorBuffer;
    00046
    00052     bool deleteRecord (uint16 recID);
    00053
    00058     static bool lock ();
    00059
    00064     static bool unlock ();
    00065
    00066   public:
    00070     Ne7sshError();
    00071
    00075     ~Ne7sshError();
    00076
    00083     bool push (int32 channel, const char* format, ...);
    00084
    00089     const char* pop ();
    00090
    00096     const char* pop (int32 channel);
    00097
    00102     bool deleteCoreMsgs ();
    00103
    00109     bool deleteChannel (int32 channel);
    00110
    00111 };
    00112
    00113 #endif