X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFuncStatus.C;h=2f0cf8e064bd3792cc37e6bdd91fd2c595f7f247;hb=6a55be9506b112110826cf63bc21786044569f1d;hp=5e7133c740199fb0f6fa5ab93c0a9a7e0ca3c427;hpb=8283e978f8d621041c432b9b88a476bfd567385c;p=lyx.git diff --git a/src/FuncStatus.C b/src/FuncStatus.C index 5e7133c740..2f0cf8e064 100644 --- a/src/FuncStatus.C +++ b/src/FuncStatus.C @@ -1,78 +1,92 @@ -/* This file is part of - * ====================================================== +/** + * \file FuncStatus.C + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * LyX, The Document Processor + * \author Jean-Marc Lasgouttes * - * Copyright 2001 The LyX Team. - * - * ====================================================== */ + * Full author contact details are available in file CREDITS. + */ #include -#ifdef __GNUG__ -#pragma implementation -#endif - #include "FuncStatus.h" +using std::string; + FuncStatus::FuncStatus() : v_(OK) { } -FuncStatus & FuncStatus::clear () +void FuncStatus::clear() { v_ = OK; - return *this; + message_.erase(); } -void FuncStatus::operator |= (FuncStatus const & f) + +void FuncStatus::operator|=(FuncStatus const & f) { v_ |= f.v_; + if (!f.message_.empty()) + message_ = f.message_; } -FuncStatus & FuncStatus::unknown (bool b) + +void FuncStatus::unknown(bool b) { if (b) v_ |= UNKNOWN; else v_ &= !UNKNOWN; - return *this; } -bool FuncStatus::unknown () const + +bool FuncStatus::unknown() const { return (v_ & UNKNOWN); } -FuncStatus & FuncStatus::disabled (bool b) +void FuncStatus::enabled(bool b) { if (b) - v_ |= DISABLED; - else v_ &= !DISABLED; - return *this; + else + v_ |= DISABLED; } -bool FuncStatus::disabled () const +bool FuncStatus::enabled() const { - return (v_ & DISABLED); + return !(v_ & DISABLED); } -void FuncStatus::setOnOff (bool b) +void FuncStatus::setOnOff(bool b) { v_ |= (b ? ON : OFF); } -bool FuncStatus::onoff (bool b) const +bool FuncStatus::onoff(bool b) const { if (b) return (v_ & ON); else return (v_ & OFF); } + + +void FuncStatus::message(string const & m) +{ + message_ = m; +} + + +string const & FuncStatus::message() const +{ + return message_; +}