Skip to main content

The ConfigInt Class Reference

Class representing an integer type option. More...

Declaration

class ConfigInt { ... }

Included Headers

#include <src/configimpl.h>

Base class

classConfigOption

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

Public Constructors Index

ConfigInt (const char *name, const char *doc, int minVal, int maxVal, int defVal)

Public Member Functions Index

QCString *valueStringRef ()
int *valueRef ()
intminVal () const
intmaxVal () const
voidconvertStrToVal (Config::CompareMode compareMode) override
voidsubstEnvVars () override
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

intm_value
intm_defValue
intm_minVal
intm_maxVal
QCStringm_valueString

Description

Class representing an integer type option.

Definition at line 219 of file configimpl.h.

Public Constructors

ConfigInt()

ConfigInt::ConfigInt (const char * name, const char * doc, int minVal, int maxVal, int defVal)
inline

Definition at line 222 of file configimpl.h.

222 ConfigInt(const char *name,const char *doc,int minVal,int maxVal,int defVal)
224 {
225 m_name = name;
226 m_doc = doc;
227 m_value = defVal;
228 m_defValue = defVal;
231 }

References ConfigOption::ConfigOption, m_defValue, ConfigOption::m_doc, m_maxVal, m_minVal, ConfigOption::m_name, m_value, maxVal, minVal, ConfigOption::name and ConfigOption::O_Int.

Public Member Functions

compareDoxyfile()

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

Declaration at line 239 of file configimpl.h, definition at line 550 of file configimpl.l.

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

convertStrToVal()

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

Declaration at line 236 of file configimpl.h, definition at line 195 of file configimpl.l.

196{
197 if (!m_valueString.isEmpty())
198 {
199 if (compareMode == Config::CompareMode::CompressedNoEnv)
200 {
201 if (containsEnvVar(m_valueString)) return;
202 }
203 bool ok = false;
204 int val = m_valueString.toInt(&ok);
205 if (!ok || val<m_minVal || val>m_maxVal)
206 {
207 ConfigImpl::config_warn("argument '{}' for option {} is not a valid number in the range [{}..{}]!\n"
208 "Using the default: {}!\n",m_valueString,m_name,m_minVal,m_maxVal,m_value);
209 }
210 else
211 {
212 m_value=val;
213 }
214 }
215}

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

init()

void ConfigInt::init ()
inline virtual

Definition at line 242 of file configimpl.h.

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

References m_defValue and m_value.

isDefault()

bool ConfigInt::isDefault ()
inline virtual

Definition at line 243 of file configimpl.h.

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

References m_defValue and m_value.

Referenced by compareDoxyfile and writeXMLDoxyfile.

maxVal()

int ConfigInt::maxVal ()
inline

Definition at line 235 of file configimpl.h.

235 int maxVal() const { return m_maxVal; }

Reference m_maxVal.

Referenced by ConfigInt.

minVal()

int ConfigInt::minVal ()
inline

Definition at line 234 of file configimpl.h.

234 int minVal() const { return m_minVal; }

Reference m_minVal.

Referenced by ConfigInt.

substEnvVars()

void ConfigInt::substEnvVars ()
virtual

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

References m_valueString and substEnvVarsInString.

valueRef()

int * ConfigInt::valueRef ()
inline

Definition at line 233 of file configimpl.h.

233 int *valueRef() { return &m_value; }

Reference m_value.

valueStringRef()

QCString * ConfigInt::valueStringRef ()
inline

Definition at line 232 of file configimpl.h.

Reference m_valueString.

Referenced by DocPara::handleDoxyConfig.

writeTemplate()

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

Declaration at line 238 of file configimpl.h, definition at line 526 of file configimpl.l.

526void ConfigInt::writeTemplate(TextStream &t,bool sl,bool upd)
527{
528 if (!sl)
529 {
530 t << "\n";
532 t << "\n";
533 }
534 else if (!m_userComment.isEmpty())
535 {
537 }
538 t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "=";
539 if (upd && !m_valueString.isEmpty())
540 {
542 }
543 else
544 {
546 }
547 t << "\n";
548}

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

Referenced by compareDoxyfile.

writeXMLDoxyfile()

void ConfigInt::writeXMLDoxyfile (TextStream & t)
virtual

Declaration at line 240 of file configimpl.h, definition at line 555 of file configimpl.l.

556{
557 t << " <option id='" << m_name << "'";
558 t << " default='" << (isDefault() ? "yes" : "no") << "'";
559 t << " type='int'";
560 t << ">";
561 t << "<value>";
562 writeIntValue(t,m_value,false);
563 t << "</value>";
564 t << "</option>\n";
565}

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

writeXSDDoxyfile()

void ConfigInt::writeXSDDoxyfile (TextStream & t)
virtual

Declaration at line 241 of file configimpl.h, definition at line 567 of file configimpl.l.

568{
569 t << " <xsd:enumeration value=\"" << m_name << "\"/>\n";
570}

Reference ConfigOption::m_name.

Private Member Attributes

m_defValue

int ConfigInt::m_defValue

Definition at line 246 of file configimpl.h.

Referenced by ConfigInt, init and isDefault.

m_maxVal

int ConfigInt::m_maxVal

Definition at line 248 of file configimpl.h.

Referenced by ConfigInt, convertStrToVal and maxVal.

m_minVal

int ConfigInt::m_minVal

Definition at line 247 of file configimpl.h.

Referenced by ConfigInt, convertStrToVal and minVal.

m_value

int ConfigInt::m_value

Definition at line 245 of file configimpl.h.

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

m_valueString

QCString ConfigInt::m_valueString

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


Generated via doxygen2docusaurus by Doxygen 1.14.0.