msg.h
Go to the documentation of this file.
/*
* steghide 0.5.1 - a steganography program
* Copyright (C) 1999-2003 Stefan Hetzl <shetzl@chello.at>
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef SH_MSG_H
#define SH_MSG_H
#include <cstdarg>
#include <string>
class MessageBase {
public:
MessageBase (void) ;
MessageBase (std::string msg) ;
MessageBase (const char* msgfmt, ...) ;
virtual ~MessageBase() {} ;
const std::string& getMessage (void) const
{ return Message ; } ;
void setMessage (std::string msg)
{ Message = msg ; } ;
void setNewline (bool prnl)
{ Newline = prnl ; } ;
const std::string getNewline (void) const
{ return (Newline ? "\n" : "") ; } ;
void setMessage (const char *msgfmt, ...) ;
virtual void printMessage (void) const = 0 ;
protected:
static const unsigned int MsgMaxSize = 512 ;
std::string compose (const char *msgfmt, ...) const ;
std::string vcompose (const char *msgfmt, va_list ap) const ;
private:
std::string Message ;
bool Newline ;
} ;
class Message : public MessageBase {
public:
Message (void) : MessageBase() {} ;
Message (std::string msg) : MessageBase (msg) {} ;
Message (const char *msgfmt, ...) ;
void printMessage (void) const ;
} ;
class VerboseMessage : public MessageBase {
public:
VerboseMessage (void) : MessageBase() {} ;
VerboseMessage (std::string msg) : MessageBase (msg) {} ;
VerboseMessage (const char *msgfmt, ...) ;
void printMessage (void) const ;
} ;
class Warning : public MessageBase {
public:
Warning (void) : MessageBase() {} ;
Warning (std::string msg) : MessageBase (msg) {} ;
Warning (const char *msgfmt, ...) ;
void printMessage (void) const ;
} ;
class CriticalWarning : public MessageBase {
public:
CriticalWarning (void) : MessageBase() {} ;
CriticalWarning (std::string msg) : MessageBase (msg) {} ;
CriticalWarning (const char *msgfmt, ...) ;
void printMessage (void) const ;
} ;
class Question : public MessageBase {
public:
Question (void) ;
Question (std::string msg) ;
Question (const char *msgfmt, ...) ;
void printMessage (void) const ;
bool getAnswer (void) ;
private:
std::string yeschar ;
std::string nochar ;
} ;
#endif /* ndef SH_MSG_H */
CriticalWarning::CriticalWarning
CriticalWarning(std::string msg)
Definition msg.h:97
CriticalWarning::CriticalWarning
CriticalWarning(void)
Definition msg.h:96
CriticalWarning::printMessage
void printMessage(void) const
Definition msg.cc:151
MessageBase::printMessage
virtual void printMessage(void) const =0
MessageBase::setMessage
void setMessage(std::string msg)
Definition msg.h:37
MessageBase::setNewline
void setNewline(bool prnl)
Definition msg.h:44
MessageBase::compose
std::string compose(const char *msgfmt,...) const
Definition msg.cc:62
MessageBase::getNewline
const std::string getNewline(void) const
Definition msg.h:50
MessageBase::getMessage
const std::string & getMessage(void) const
Definition msg.h:34
MessageBase::vcompose
std::string vcompose(const char *msgfmt, va_list ap) const
Definition msg.cc:71
MessageBase::Newline
bool Newline
Definition msg.h:64
MessageBase::Message
std::string Message
Definition msg.h:63
MessageBase::~MessageBase
virtual ~MessageBase()
Definition msg.h:32
MessageBase::MessageBase
MessageBase(void)
Definition msg.cc:33
MessageBase::MsgMaxSize
static const unsigned int MsgMaxSize
Definition msg.h:57
Message::Message
Message(void)
Definition msg.h:69
Message::Message
Message(std::string msg)
Definition msg.h:70
Message::printMessage
void printMessage(void) const
Definition msg.cc:92
Question::Question
Question(void)
Definition msg.cc:159
Question::printMessage
void printMessage(void) const
Definition msg.cc:185
Question::yeschar
std::string yeschar
Definition msg.h:118
Question::nochar
std::string nochar
Definition msg.h:119
Question::getAnswer
bool getAnswer(void)
Definition msg.cc:194
VerboseMessage::VerboseMessage
VerboseMessage(std::string msg)
Definition msg.h:79
VerboseMessage::VerboseMessage
VerboseMessage(void)
Definition msg.h:78
VerboseMessage::printMessage
void printMessage(void) const
Definition msg.cc:113
Warning::Warning
Warning(void)
Definition msg.h:87
Warning::Warning
Warning(std::string msg)
Definition msg.h:88
Warning::printMessage
void printMessage(void) const
Definition msg.cc:132