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 186 of file configimpl.h.

Member Enumeration Documentation

◆ WidgetType

Enumerator
String 
File 
Dir 
Image 
FileAndDir 

Definition at line 189 of file configimpl.h.

Constructor & Destructor Documentation

◆ ConfigString()

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

Definition at line 190 of file configimpl.h.

192 {
193 m_name = name;
194 m_doc = doc;
196 }
QCString m_doc
Definition configimpl.h:96
ConfigOption(OptionType t)
Definition configimpl.h:63
QCString m_name
Definition configimpl.h:95
QCString name() const
Definition configimpl.h:70
@ O_String
A single item.
Definition configimpl.h:50
WidgetType m_widgetType
Definition configimpl.h:213

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 512 of file configimpl.l.

513{
514 if (!isDefault()) writeTemplate(t,TRUE,TRUE);
515}
bool isDefault() override
Definition configimpl.h:208
void writeTemplate(TextStream &t, bool sl, bool) override
Definition configimpl.l:495
#define TRUE
Definition qcstring.h:37

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

◆ emptyValueToDefault()

void ConfigString::emptyValueToDefault ( )
inlineoverridevirtual

Reimplemented from ConfigOption.

Definition at line 207 of file configimpl.h.

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

References m_defValue, and m_value.

◆ init()

void ConfigString::init ( )
inlineoverridevirtual

Reimplemented from ConfigOption.

Definition at line 206 of file configimpl.h.

206{ 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 208 of file configimpl.h.

208{ 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 199 of file configimpl.h.

199{ m_defValue = v; }

References m_defValue.

◆ setWidgetType()

void ConfigString::setWidgetType ( WidgetType w)
inline

Definition at line 197 of file configimpl.h.

197{ m_widgetType = w; }

References m_widgetType.

◆ substEnvVars()

void ConfigString::substEnvVars ( )
overridevirtual

Implements ConfigOption.

Definition at line 1514 of file configimpl.l.

1515{
1517}
static void substEnvVarsInString(QCString &s)

References m_value, and substEnvVarsInString().

◆ valueRef()

QCString * ConfigString::valueRef ( )
inline

Definition at line 200 of file configimpl.h.

200{ return &m_value; }

References m_value.

Referenced by checkEncoding().

◆ widgetType()

WidgetType ConfigString::widgetType ( ) const
inline

Definition at line 198 of file configimpl.h.

198{ return m_widgetType; }

References m_widgetType.

◆ writeTemplate()

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

Implements ConfigOption.

Definition at line 495 of file configimpl.l.

496{
497 if (!sl)
498 {
499 t << "\n";
501 t << "\n";
502 }
503 else if (!m_userComment.isEmpty())
504 {
506 }
507 t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "=";
509 t << "\n";
510}
void writeStringValue(TextStream &t, const QCString &s, bool initSpace=true, bool wasQuoted=false)
Definition configimpl.l:149
QCString m_userComment
Definition configimpl.h:99
QCString m_spaces
Definition configimpl.h:94
static QCString convertToComment(const QCString &s, const QCString &u)
Definition configimpl.l:98

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 517 of file configimpl.l.

518{
519 t << " <option id='" << m_name << "'";
520 t << " default='" << (isDefault() ? "yes" : "no") << "'";
521 t << " type='string'";
522 t << ">";
523 t << "<value>";
524 t << "<![CDATA[";
525 writeStringValue(t,m_value,false);
526 t << "]]>";
527 t << "</value>";
528 t << "</option>\n";
529}

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

◆ writeXSDDoxyfile()

void ConfigString::writeXSDDoxyfile ( TextStream & t)
overridevirtual

Implements ConfigOption.

Definition at line 531 of file configimpl.l.

532{
533 t << " <xsd:enumeration value=\"" << m_name << "\"/>\n";
534}

References ConfigOption::m_name.

Member Data Documentation

◆ m_defValue

QCString ConfigString::m_defValue
private

Definition at line 212 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 213 of file configimpl.h.

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


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