Skip to main content

The ConfigBool Class Reference

Class representing a Boolean type option. More...

Declaration

class ConfigBool { ... }

Included Headers

#include <src/configimpl.h>

Base class

classConfigOption

Abstract base class for any configuration option. More...

Public Constructors Index

ConfigBool (const char *name, const char *doc, bool defVal)

Public Member Functions Index

QCString *valueStringRef ()
bool *valueRef ()
voidconvertStrToVal (Config::CompareMode compareMode) override
voidsubstEnvVars () override
voidsetValueString (const QCString &v)
voidwriteTemplate (TextStream &t, bool sl, bool upd) override
voidcompareDoxyfile (TextStream &t, Config::CompareMode compareMode) override
voidwriteXMLDoxyfile (TextStream &t) override
voidwriteXSDDoxyfile (TextStream &t) override
voidinit () override
boolisDefault () override

Private Member Attributes Index

boolm_value
boolm_defValue
QCStringm_valueString

Description

Class representing a Boolean type option.

Definition at line 254 of file configimpl.h.

Public Constructors

ConfigBool()

ConfigBool::ConfigBool (const char * name, const char * doc, bool defVal)
inline

Definition at line 257 of file configimpl.h.

257 ConfigBool(const char *name,const char *doc,bool defVal)
259 {
260 m_name = name;
261 m_doc = doc;
262 m_value = defVal;
263 m_defValue = defVal;
264 }

References ConfigOption::ConfigOption, m_defValue, ConfigOption::m_doc, ConfigOption::m_name, m_value, ConfigOption::name and ConfigOption::O_Bool.

Public Member Functions

compareDoxyfile()

void ConfigBool::compareDoxyfile (TextStream & t, Config::CompareMode compareMode)
virtual

Declaration at line 271 of file configimpl.h, definition at line 597 of file configimpl.l.

References Config::CompressedNoEnv, containsEnvVar, isDefault, m_valueString, TRUE and writeTemplate.

convertStrToVal()

void ConfigBool::convertStrToVal (Config::CompareMode compareMode)
virtual

Declaration at line 267 of file configimpl.h, definition at line 237 of file configimpl.l.

238{
239 if (!m_valueString.stripWhiteSpace().isEmpty())
240 {
241 if (compareMode == Config::CompareMode::CompressedNoEnv)
242 {
243 if (containsEnvVar(m_valueString)) return;
244 }
245 bool isValid=false;
246 bool b = convertStringToBool(m_valueString,isValid);
247 if (isValid)
248 {
249 m_value=b;
250 }
251 else
252 {
253 ConfigImpl::config_warn("argument '{}' for option {} is not a valid boolean value\n"
254 "Using the default: {}!\n",m_valueString,m_name,m_value?"YES":"NO");
255 }
256 }
257}

References Config::CompressedNoEnv, ConfigImpl::config_warn, containsEnvVar, convertStringToBool, ConfigOption::m_name, m_value and m_valueString.

init()

void ConfigBool::init ()
inline virtual

Definition at line 274 of file configimpl.h.

274 void init() override { m_value = m_defValue; }

References m_defValue and m_value.

isDefault()

bool ConfigBool::isDefault ()
inline virtual

Definition at line 275 of file configimpl.h.

275 bool isDefault() override { return m_value == m_defValue; }

References m_defValue and m_value.

Referenced by compareDoxyfile and writeXMLDoxyfile.

setValueString()

void ConfigBool::setValueString (const QCString & v)
inline

Definition at line 269 of file configimpl.h.

269 void setValueString(const QCString &v) { m_valueString = v; }

Reference m_valueString.

substEnvVars()

void ConfigBool::substEnvVars ()
virtual

Declaration at line 268 of file configimpl.h, definition at line 1516 of file configimpl.l.

References m_valueString and substEnvVarsInString.

valueRef()

bool * ConfigBool::valueRef ()
inline

Definition at line 266 of file configimpl.h.

266 bool *valueRef() { return &m_value; }

Reference m_value.

valueStringRef()

QCString * ConfigBool::valueStringRef ()
inline

Definition at line 265 of file configimpl.h.

Reference m_valueString.

Referenced by DocPara::handleDoxyConfig and Config::updateObsolete.

writeTemplate()

void ConfigBool::writeTemplate (TextStream & t, bool sl, bool upd)
virtual

Declaration at line 270 of file configimpl.h, definition at line 572 of file configimpl.l.

572void ConfigBool::writeTemplate(TextStream &t,bool sl,bool upd)
573{
574 if (!sl)
575 {
576 t << "\n";
578 t << "\n";
579 }
580 else if (!m_userComment.isEmpty())
581 {
583 }
584 QCString spaces = m_spaces.left(MAX_OPTION_LENGTH-m_name.length());
585 t << m_name << spaces << "=";
586 if (upd && !m_valueString.isEmpty())
587 {
589 }
590 else
591 {
593 }
594 t << "\n";
595}

References convertToComment, ConfigOption::m_doc, ConfigOption::m_name, ConfigOption::m_spaces, ConfigOption::m_userComment, m_value, m_valueString, ConfigOption::MAX_OPTION_LENGTH, ConfigOption::writeBoolValue and ConfigOption::writeStringValue.

Referenced by compareDoxyfile.

writeXMLDoxyfile()

void ConfigBool::writeXMLDoxyfile (TextStream & t)
virtual

Declaration at line 272 of file configimpl.h, definition at line 602 of file configimpl.l.

603{
604 t << " <option id='" << m_name << "'";
605 t << " default='" << (isDefault() ? "yes" : "no") << "'";
606 t << " type='bool'";
607 t << ">";
608 t << "<value>";
609 writeBoolValue(t,m_value,false);
610 t << "</value>";
611 t << "</option>\n";
612}

References isDefault, ConfigOption::m_name, m_value and ConfigOption::writeBoolValue.

writeXSDDoxyfile()

void ConfigBool::writeXSDDoxyfile (TextStream & t)
virtual

Declaration at line 273 of file configimpl.h, definition at line 614 of file configimpl.l.

615{
616 t << " <xsd:enumeration value=\"" << m_name << "\"/>\n";
617}

Reference ConfigOption::m_name.

Private Member Attributes

m_defValue

bool ConfigBool::m_defValue

Definition at line 278 of file configimpl.h.

Referenced by ConfigBool, init and isDefault.

m_value

bool ConfigBool::m_value

Definition at line 277 of file configimpl.h.

277 bool m_value;

Referenced by ConfigBool, convertStrToVal, init, isDefault, valueRef, writeTemplate and writeXMLDoxyfile.

m_valueString

QCString ConfigBool::m_valueString

The documentation for this class was generated from the following files:


Generated via doxygen2docusaurus by Doxygen 1.14.0.