Doxygen
Loading...
Searching...
No Matches
PerlModOutput Class Reference
+ Collaboration diagram for PerlModOutput:

Public Member Functions

 PerlModOutput (bool pretty)
 
virtual ~PerlModOutput ()
 
void reset ()
 
void setPerlModOutputStream (PerlModOutputStream *os)
 
PerlModOutputcontinueBlock ()
 
PerlModOutputadd (char c)
 
PerlModOutputadd (const QCString &s)
 
PerlModOutputadd (QCString &s)
 
PerlModOutputadd (int n)
 
PerlModOutputadd (unsigned int n)
 
PerlModOutputaddQuoted (const QCString &s)
 
PerlModOutputindent ()
 
PerlModOutputopen (char c, const QCString &s=QCString())
 
PerlModOutputclose (char c=0)
 
PerlModOutputaddField (const QCString &s)
 
PerlModOutputaddFieldQuotedChar (const QCString &field, char content)
 
PerlModOutputaddFieldQuotedString (const QCString &field, const QCString &content)
 
PerlModOutputaddFieldBoolean (const QCString &field, bool content)
 
PerlModOutputopenList (const QCString &s=QCString())
 
PerlModOutputcloseList ()
 
PerlModOutputopenHash (const QCString &s=QCString())
 
PerlModOutputcloseHash ()
 

Public Attributes

bool m_pretty
 

Protected Member Functions

void incIndent ()
 
void decIndent ()
 
void iaddQuoted (const QCString &)
 
void iaddFieldQuotedChar (const QCString &, char)
 
void iaddFieldQuotedString (const QCString &, const QCString &)
 
void iaddField (const QCString &)
 
void iopen (char, const QCString &)
 
void iclose (char)
 

Private Attributes

PerlModOutputStreamm_stream
 
int m_indentation
 
bool m_blockstart
 
char m_spaces [PERLOUTPUT_MAX_INDENTATION *2+2]
 

Detailed Description

Definition at line 80 of file perlmodgen.cpp.

Constructor & Destructor Documentation

◆ PerlModOutput()

PerlModOutput::PerlModOutput ( bool pretty)
inline

Definition at line 86 of file perlmodgen.cpp.

87 : m_pretty(pretty), m_stream(nullptr), m_indentation(false), m_blockstart(true)
88 {
89 m_spaces[0] = 0;
90 }
char m_spaces[PERLOUTPUT_MAX_INDENTATION *2+2]
PerlModOutputStream * m_stream

References m_blockstart, m_indentation, m_pretty, m_spaces, and m_stream.

Referenced by add(), add(), add(), add(), add(), addField(), addFieldBoolean(), addFieldQuotedChar(), addFieldQuotedString(), addQuoted(), close(), closeHash(), closeList(), continueBlock(), indent(), open(), openHash(), and openList().

◆ ~PerlModOutput()

virtual PerlModOutput::~PerlModOutput ( )
inlinevirtual

Definition at line 92 of file perlmodgen.cpp.

92{ reset(); }

References reset().

Member Function Documentation

◆ add() [1/5]

PerlModOutput & PerlModOutput::add ( char c)
inline

Definition at line 112 of file perlmodgen.cpp.

112{ m_stream->add(c); return *this; }

References m_stream, and PerlModOutput().

Referenced by addPerlModDocBlock().

◆ add() [2/5]

PerlModOutput & PerlModOutput::add ( const QCString & s)
inline

Definition at line 113 of file perlmodgen.cpp.

113{ m_stream->add(s); return *this; }

References m_stream, and PerlModOutput().

◆ add() [3/5]

PerlModOutput & PerlModOutput::add ( int n)
inline

Definition at line 115 of file perlmodgen.cpp.

115{ m_stream->add(n); return *this; }

References m_stream, and PerlModOutput().

◆ add() [4/5]

PerlModOutput & PerlModOutput::add ( QCString & s)
inline

Definition at line 114 of file perlmodgen.cpp.

114{ m_stream->add(s); return *this; }

References m_stream, and PerlModOutput().

◆ add() [5/5]

PerlModOutput & PerlModOutput::add ( unsigned int n)
inline

Definition at line 116 of file perlmodgen.cpp.

116{ m_stream->add(n); return *this; }

References m_stream, and PerlModOutput().

◆ addField()

PerlModOutput & PerlModOutput::addField ( const QCString & s)
inline

Definition at line 132 of file perlmodgen.cpp.

132{ iaddField(s); return *this; }
void iaddField(const QCString &)

References iaddField(), and PerlModOutput().

Referenced by addPerlModDocBlock().

◆ addFieldBoolean()

PerlModOutput & PerlModOutput::addFieldBoolean ( const QCString & field,
bool content )
inline

Definition at line 141 of file perlmodgen.cpp.

142 {
143 return addFieldQuotedString(field, content ? "yes" : "no");
144 }
PerlModOutput & addFieldQuotedString(const QCString &field, const QCString &content)

References addFieldQuotedString(), and PerlModOutput().

◆ addFieldQuotedChar()

PerlModOutput & PerlModOutput::addFieldQuotedChar ( const QCString & field,
char content )
inline

Definition at line 133 of file perlmodgen.cpp.

134 {
135 iaddFieldQuotedChar(field, content); return *this;
136 }
void iaddFieldQuotedChar(const QCString &, char)

References iaddFieldQuotedChar(), and PerlModOutput().

◆ addFieldQuotedString()

PerlModOutput & PerlModOutput::addFieldQuotedString ( const QCString & field,
const QCString & content )
inline

Definition at line 137 of file perlmodgen.cpp.

138 {
139 iaddFieldQuotedString(field, content); return *this;
140 }
void iaddFieldQuotedString(const QCString &, const QCString &)

References iaddFieldQuotedString(), and PerlModOutput().

Referenced by addFieldBoolean(), and addTemplateArgumentList().

◆ addQuoted()

PerlModOutput & PerlModOutput::addQuoted ( const QCString & s)
inline

Definition at line 118 of file perlmodgen.cpp.

118{ iaddQuoted(s); return *this; }
void iaddQuoted(const QCString &)

References iaddQuoted(), and PerlModOutput().

◆ close()

PerlModOutput & PerlModOutput::close ( char c = 0)
inline

Definition at line 130 of file perlmodgen.cpp.

130{ iclose(c); return *this; }
void iclose(char)

References iclose(), and PerlModOutput().

Referenced by closeHash(), and closeList().

◆ closeHash()

PerlModOutput & PerlModOutput::closeHash ( )
inline

Definition at line 148 of file perlmodgen.cpp.

148{ close('}'); return *this; }
PerlModOutput & close(char c=0)

References close(), and PerlModOutput().

Referenced by addPerlModDocBlock(), and addTemplateArgumentList().

◆ closeList()

PerlModOutput & PerlModOutput::closeList ( )
inline

Definition at line 146 of file perlmodgen.cpp.

146{ close(']'); return *this; }

References close(), and PerlModOutput().

Referenced by addTemplateArgumentList().

◆ continueBlock()

PerlModOutput & PerlModOutput::continueBlock ( )
inline

Definition at line 102 of file perlmodgen.cpp.

103 {
104 if (m_blockstart)
105 m_blockstart = false;
106 else
107 m_stream->add(',');
108 indent();
109 return *this;
110 }
PerlModOutput & indent()

References indent(), m_blockstart, m_stream, and PerlModOutput().

Referenced by iaddField(), and iopen().

◆ decIndent()

void PerlModOutput::decIndent ( )
protected

Definition at line 200 of file perlmodgen.cpp.

201{
204 m_spaces[m_indentation * 2] = 0;
205}
#define PERLOUTPUT_MAX_INDENTATION

References m_indentation, m_spaces, and PERLOUTPUT_MAX_INDENTATION.

Referenced by iclose().

◆ iaddField()

void PerlModOutput::iaddField ( const QCString & s)
protected

Definition at line 222 of file perlmodgen.cpp.

223{
225 m_stream->add(s);
226 m_stream->add(m_pretty ? " => " : "=>");
227}
PerlModOutput & continueBlock()

References continueBlock(), m_pretty, and m_stream.

Referenced by addField(), iaddFieldQuotedChar(), iaddFieldQuotedString(), and iopen().

◆ iaddFieldQuotedChar()

void PerlModOutput::iaddFieldQuotedChar ( const QCString & field,
char content )
protected

Definition at line 229 of file perlmodgen.cpp.

230{
231 iaddField(field);
232 m_stream->add('\'');
233 if ((content == '\'') || (content == '\\'))
234 m_stream->add('\\');
235 m_stream->add(content);
236 m_stream->add('\'');
237}

References iaddField(), and m_stream.

Referenced by addFieldQuotedChar().

◆ iaddFieldQuotedString()

void PerlModOutput::iaddFieldQuotedString ( const QCString & field,
const QCString & content )
protected

Definition at line 239 of file perlmodgen.cpp.

240{
241 if (content == nullptr)
242 return;
243 iaddField(field);
244 m_stream->add('\'');
245 iaddQuoted(content);
246 m_stream->add('\'');
247}

References iaddField(), iaddQuoted(), and m_stream.

Referenced by addFieldQuotedString().

◆ iaddQuoted()

void PerlModOutput::iaddQuoted ( const QCString & str)
protected

Definition at line 207 of file perlmodgen.cpp.

208{
209 if (str.isEmpty()) return;
210 const char *s = str.data();
211 char c = 0;
212 while ((c = *s++) != 0)
213 {
214 if ((c == '\'') || (c == '\\'))
215 {
216 m_stream->add('\\');
217 }
218 m_stream->add(c);
219 }
220}
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:159

References QCString::data(), QCString::isEmpty(), and m_stream.

Referenced by addQuoted(), and iaddFieldQuotedString().

◆ iclose()

void PerlModOutput::iclose ( char c)
protected

Definition at line 260 of file perlmodgen.cpp.

261{
262 decIndent();
263 indent();
264 if (c != 0)
265 m_stream->add(c);
266 m_blockstart = false;
267}

References decIndent(), indent(), m_blockstart, and m_stream.

Referenced by close().

◆ incIndent()

void PerlModOutput::incIndent ( )
protected

Definition at line 190 of file perlmodgen.cpp.

191{
193 {
194 char *s = &m_spaces[m_indentation * 2];
195 *s++ = ' '; *s++ = ' '; *s = 0;
196 }
198}

References m_indentation, m_spaces, and PERLOUTPUT_MAX_INDENTATION.

Referenced by iopen().

◆ indent()

PerlModOutput & PerlModOutput::indent ( )
inline

Definition at line 120 of file perlmodgen.cpp.

121 {
122 if (m_pretty) {
123 m_stream->add('\n');
124 m_stream->add(m_spaces);
125 }
126 return *this;
127 }

References m_pretty, m_spaces, m_stream, and PerlModOutput().

Referenced by continueBlock(), and iclose().

◆ iopen()

void PerlModOutput::iopen ( char c,
const QCString & s )
protected

Definition at line 249 of file perlmodgen.cpp.

250{
251 if (s != nullptr)
252 iaddField(s);
253 else
255 m_stream->add(c);
256 incIndent();
257 m_blockstart = true;
258}

References continueBlock(), iaddField(), incIndent(), m_blockstart, and m_stream.

Referenced by open().

◆ open()

PerlModOutput & PerlModOutput::open ( char c,
const QCString & s = QCString() )
inline

Definition at line 129 of file perlmodgen.cpp.

129{ iopen(c, s); return *this; }
void iopen(char, const QCString &)

References iopen(), and PerlModOutput().

Referenced by openHash(), and openList().

◆ openHash()

PerlModOutput & PerlModOutput::openHash ( const QCString & s = QCString())
inline

Definition at line 147 of file perlmodgen.cpp.

147{ open('{', s); return *this; }
PerlModOutput & open(char c, const QCString &s=QCString())

References open(), and PerlModOutput().

Referenced by addPerlModDocBlock(), and addTemplateArgumentList().

◆ openList()

PerlModOutput & PerlModOutput::openList ( const QCString & s = QCString())
inline

Definition at line 145 of file perlmodgen.cpp.

145{ open('[', s); return *this; }

References open(), and PerlModOutput().

Referenced by addTemplateArgumentList().

◆ reset()

void PerlModOutput::reset ( )
inline

Definition at line 95 of file perlmodgen.cpp.

95{ m_stream=nullptr; }

References m_stream, and reset().

Referenced by reset(), and ~PerlModOutput().

◆ setPerlModOutputStream()

void PerlModOutput::setPerlModOutputStream ( PerlModOutputStream * os)
inline

Definition at line 97 of file perlmodgen.cpp.

97{ m_stream = os; }

References m_stream.

Member Data Documentation

◆ m_blockstart

bool PerlModOutput::m_blockstart
private

Definition at line 170 of file perlmodgen.cpp.

Referenced by continueBlock(), iclose(), iopen(), and PerlModOutput().

◆ m_indentation

int PerlModOutput::m_indentation
private

Definition at line 169 of file perlmodgen.cpp.

Referenced by decIndent(), incIndent(), and PerlModOutput().

◆ m_pretty

bool PerlModOutput::m_pretty

Definition at line 84 of file perlmodgen.cpp.

Referenced by iaddField(), indent(), and PerlModOutput().

◆ m_spaces

char PerlModOutput::m_spaces[PERLOUTPUT_MAX_INDENTATION *2+2]
private

Definition at line 173 of file perlmodgen.cpp.

Referenced by decIndent(), incIndent(), indent(), and PerlModOutput().

◆ m_stream


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