Doxygen
Loading...
Searching...
No Matches
ConfigString Class Reference

Class representing a string type option. More...

#include <src/configimpl.h>

+ Inheritance diagram for ConfigString:
+ Collaboration diagram for ConfigString:

Public Types

enum  WidgetType {
  String , File , Dir , Image ,
  FileAndDir
}
 
- Public Types inherited from ConfigOption
enum  OptionType {
  O_Info , O_List , O_Enum , O_String ,
  O_Int , O_Bool , O_Obsolete , O_Disabled
}
 
enum  { MAX_OPTION_LENGTH = 23 }
 

Public Member Functions

 ConfigString (const char *name, const char *doc)
 
void setWidgetType (WidgetType w)
 
WidgetType widgetType () const
 
void setDefaultValue (const char *v)
 
QCStringvalueRef ()
 
void writeTemplate (TextStream &t, bool sl, bool) override
 
void compareDoxyfile (TextStream &t, Config::CompareMode compareMode) override
 
void writeXMLDoxyfile (TextStream &t) override
 
void writeXSDDoxyfile (TextStream &t) override
 
void substEnvVars () override
 
void init () override
 
void emptyValueToDefault () override
 
bool isDefault () override
 
- Public Member Functions inherited from ConfigOption
 ConfigOption (OptionType t)
 
OptionType kind () const
 
QCString name () const
 
QCString docs () const
 
QCString dependsOn () const
 
void addDependency (const char *dep)
 
void setEncoding (const QCString &e)
 
void setUserComment (const QCString &u)
 

Private Attributes

QCString m_value
 
QCString m_defValue
 
WidgetType m_widgetType
 

Additional Inherited Members

- Protected Member Functions inherited from ConfigOption
virtual void convertStrToVal (Config::CompareMode)
 
void writeBoolValue (TextStream &t, bool v, bool initSpace=true)
 
void writeIntValue (TextStream &t, int i, bool initSpace=true)
 
void writeStringValue (TextStream &t, const QCString &s, bool initSpace=true, bool wasQuoted=false)
 
void writeStringList (TextStream &t, const StringVector &l)
 
- Protected Attributes inherited from ConfigOption
QCString m_spaces
 
QCString m_name
 
QCString m_doc
 
QCString m_dependency
 
QCString m_encoding
 
QCString m_userComment
 
OptionType m_kind
 

Detailed Description

Class representing a string type option.

Definition at line 187 of file configimpl.h.

Member Enumeration Documentation

◆ WidgetType

Enumerator
String 
File 
Dir 
Image 
FileAndDir 

Definition at line 190 of file configimpl.h.

Constructor & Destructor Documentation

◆ ConfigString()

ConfigString::ConfigString ( const char * name,
const char * doc )
inline

Definition at line 191 of file configimpl.h.

193 {
194 m_name = name;
195 m_doc = doc;
197 }
QCString m_doc
Definition configimpl.h:97
ConfigOption(OptionType t)
Definition configimpl.h:64
QCString m_name
Definition configimpl.h:96
QCString name() const
Definition configimpl.h:71
@ O_String
A single item.
Definition configimpl.h:51
WidgetType m_widgetType
Definition configimpl.h:214

References ConfigOption::ConfigOption(), ConfigOption::m_doc, ConfigOption::m_name, m_widgetType, ConfigOption::name(), ConfigOption::O_String, and String.

Member Function Documentation

◆ compareDoxyfile()

void ConfigString::compareDoxyfile ( TextStream & t,
Config::CompareMode compareMode )
overridevirtual

Implements ConfigOption.

Definition at line 502 of file configimpl.l.

503{
504 if (!isDefault()) writeTemplate(t,TRUE,TRUE);
505}
bool isDefault() override
Definition configimpl.h:209
void writeTemplate(TextStream &t, bool sl, bool) override
Definition configimpl.l:485
#define TRUE
Definition qcstring.h:37

References isDefault(), TRUE, and writeTemplate().

◆ emptyValueToDefault()

void ConfigString::emptyValueToDefault ( )
inlineoverridevirtual

Reimplemented from ConfigOption.

Definition at line 208 of file configimpl.h.

208{ if (m_value.isEmpty()) m_value=m_defValue; };
QCString m_value
Definition configimpl.h:212
QCString m_defValue
Definition configimpl.h:213

References m_defValue, and m_value.

◆ init()

void ConfigString::init ( )
inlineoverridevirtual

Reimplemented from ConfigOption.

Definition at line 207 of file configimpl.h.

207{ m_value = m_defValue; }

References m_defValue, and m_value.

Referenced by Config::parse().

◆ isDefault()

bool ConfigString::isDefault ( )
inlineoverridevirtual

Reimplemented from ConfigOption.

Definition at line 209 of file configimpl.h.

209{ return m_value.stripWhiteSpace() == m_defValue.stripWhiteSpace(); }

References m_defValue, and m_value.

Referenced by compareDoxyfile(), and writeXMLDoxyfile().

◆ setDefaultValue()

void ConfigString::setDefaultValue ( const char * v)
inline

Definition at line 200 of file configimpl.h.

200{ m_defValue = v; }

References m_defValue.

◆ setWidgetType()

void ConfigString::setWidgetType ( WidgetType w)
inline

Definition at line 198 of file configimpl.h.

198{ m_widgetType = w; }

References m_widgetType.

◆ substEnvVars()

void ConfigString::substEnvVars ( )
overridevirtual

Implements ConfigOption.

Definition at line 1506 of file configimpl.l.

1507{
1509}
static void substEnvVarsInString(QCString &s)

References m_value, and substEnvVarsInString().

◆ valueRef()

QCString * ConfigString::valueRef ( )
inline

Definition at line 201 of file configimpl.h.

201{ return &m_value; }

References m_value.

Referenced by checkEncoding(), and DocPara::handleDoxyConfig().

◆ widgetType()

WidgetType ConfigString::widgetType ( ) const
inline

Definition at line 199 of file configimpl.h.

199{ return m_widgetType; }

References m_widgetType.

◆ writeTemplate()

void ConfigString::writeTemplate ( TextStream & t,
bool sl,
bool  )
overridevirtual

Implements ConfigOption.

Definition at line 485 of file configimpl.l.

486{
487 if (!sl)
488 {
489 t << "\n";
491 t << "\n";
492 }
493 else if (!m_userComment.isEmpty())
494 {
496 }
497 t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "=";
499 t << "\n";
500}
void writeStringValue(TextStream &t, const QCString &s, bool initSpace=true, bool wasQuoted=false)
Definition configimpl.l:139
QCString m_userComment
Definition configimpl.h:100
QCString m_spaces
Definition configimpl.h:95
static QCString convertToComment(const QCString &s, const QCString &u)
Definition configimpl.l:88

References convertToComment(), ConfigOption::m_doc, ConfigOption::m_name, ConfigOption::m_spaces, ConfigOption::m_userComment, m_value, ConfigOption::MAX_OPTION_LENGTH, and ConfigOption::writeStringValue().

Referenced by compareDoxyfile().

◆ writeXMLDoxyfile()

void ConfigString::writeXMLDoxyfile ( TextStream & t)
overridevirtual

Implements ConfigOption.

Definition at line 507 of file configimpl.l.

508{
509 t << " <option id='" << m_name << "'";
510 t << " default='" << (isDefault() ? "yes" : "no") << "'";
511 t << " type='string'";
512 t << ">";
513 t << "<value>";
514 t << "<![CDATA[";
515 writeStringValue(t,m_value,false);
516 t << "]]>";
517 t << "</value>";
518 t << "</option>\n";
519}

References isDefault(), ConfigOption::m_name, m_value, and ConfigOption::writeStringValue().

◆ writeXSDDoxyfile()

void ConfigString::writeXSDDoxyfile ( TextStream & t)
overridevirtual

Implements ConfigOption.

Definition at line 521 of file configimpl.l.

522{
523 t << " <xsd:enumeration value=\"" << m_name << "\"/>\n";
524}

References ConfigOption::m_name.

Member Data Documentation

◆ m_defValue

QCString ConfigString::m_defValue
private

Definition at line 213 of file configimpl.h.

Referenced by emptyValueToDefault(), init(), isDefault(), and setDefaultValue().

◆ m_value

QCString ConfigString::m_value
private

◆ m_widgetType

WidgetType ConfigString::m_widgetType
private

Definition at line 214 of file configimpl.h.

Referenced by ConfigString(), setWidgetType(), and widgetType().


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