Skip to main content

The PerlModOutput Class Reference

Declaration

class PerlModOutput { ... }

Public Constructors Index

PerlModOutput (bool pretty)

Public Destructor Index

~PerlModOutput ()

Public Member Functions Index

voidreset ()
voidsetPerlModOutputStream (PerlModOutputStream *os)
PerlModOutput &continueBlock ()
PerlModOutput &add (char c)
PerlModOutput &add (const QCString &s)
PerlModOutput &add (QCString &s)
PerlModOutput &add (int n)
PerlModOutput &add (unsigned int n)
PerlModOutput &addQuoted (const QCString &s)
PerlModOutput &indent ()
PerlModOutput &open (char c, const QCString &s=QCString())
PerlModOutput &close (char c=0)
PerlModOutput &addField (const QCString &s)
PerlModOutput &addFieldQuotedChar (const QCString &field, char content)
PerlModOutput &addFieldQuotedString (const QCString &field, const QCString &content)
PerlModOutput &addFieldBoolean (const QCString &field, bool content)
PerlModOutput &openList (const QCString &s=QCString())
PerlModOutput &closeList ()
PerlModOutput &openHash (const QCString &s=QCString())
PerlModOutput &closeHash ()

Protected Member Functions Index

voidincIndent ()
voiddecIndent ()
voidiaddQuoted (const QCString &)
voidiaddFieldQuotedChar (const QCString &, char)
voidiaddFieldQuotedString (const QCString &, const QCString &)
voidiaddField (const QCString &)
voidiopen (char, const QCString &)
voidiclose (char)

Public Member Attributes Index

boolm_pretty

Private Member Attributes Index

PerlModOutputStream *m_stream
intm_indentation
boolm_blockstart
charm_spaces[PERLOUTPUT_MAX_INDENTATION *2+2]

Definition at line 81 of file perlmodgen.cpp.

Public Constructors

PerlModOutput()

PerlModOutput::PerlModOutput (bool pretty)
inline

Definition at line 87 of file perlmodgen.cpp.

87 inline PerlModOutput(bool pretty)
88 : m_pretty(pretty), m_stream(nullptr), m_indentation(false), m_blockstart(true)
89 {
90 m_spaces[0] = 0;
91 }

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.

Public Destructor

~PerlModOutput()

virtual PerlModOutput::~PerlModOutput ()
inline virtual

Definition at line 93 of file perlmodgen.cpp.

93 virtual ~PerlModOutput() { reset(); }

Reference reset.

Public Member Functions

add()

PerlModOutput & PerlModOutput::add (char c)
inline

Definition at line 113 of file perlmodgen.cpp.

113 inline PerlModOutput &add(char c) { m_stream->add(c); return *this; }

References m_stream and PerlModOutput.

Referenced by addPerlModDocBlock.

add()

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

Definition at line 114 of file perlmodgen.cpp.

114 inline PerlModOutput &add(const QCString &s) { m_stream->add(s); return *this; }

References m_stream and PerlModOutput.

add()

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

Definition at line 115 of file perlmodgen.cpp.

115 inline PerlModOutput &add(QCString &s) { m_stream->add(s); return *this; }

References m_stream and PerlModOutput.

add()

PerlModOutput & PerlModOutput::add (int n)
inline

Definition at line 116 of file perlmodgen.cpp.

116 inline PerlModOutput &add(int n) { m_stream->add(n); return *this; }

References m_stream and PerlModOutput.

add()

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

Definition at line 117 of file perlmodgen.cpp.

117 inline PerlModOutput &add(unsigned int n) { m_stream->add(n); return *this; }

References m_stream and PerlModOutput.

addField()

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

Definition at line 133 of file perlmodgen.cpp.

133 inline PerlModOutput &addField(const QCString &s) { iaddField(s); return *this; }

References iaddField and PerlModOutput.

Referenced by addPerlModDocBlock.

addFieldBoolean()

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

Definition at line 142 of file perlmodgen.cpp.

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

References addFieldQuotedString and PerlModOutput.

addFieldQuotedChar()

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

Definition at line 134 of file perlmodgen.cpp.

134 inline PerlModOutput &addFieldQuotedChar(const QCString &field, char content)
135 {
136 iaddFieldQuotedChar(field, content); return *this;
137 }

References iaddFieldQuotedChar and PerlModOutput.

addFieldQuotedString()

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

Definition at line 138 of file perlmodgen.cpp.

138 inline PerlModOutput &addFieldQuotedString(const QCString &field, const QCString &content)
139 {
140 iaddFieldQuotedString(field, content); return *this;
141 }

References iaddFieldQuotedString and PerlModOutput.

Referenced by addFieldBoolean and addTemplateArgumentList.

addQuoted()

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

Definition at line 119 of file perlmodgen.cpp.

119 PerlModOutput &addQuoted(const QCString &s) { iaddQuoted(s); return *this; }

References iaddQuoted and PerlModOutput.

close()

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

Definition at line 131 of file perlmodgen.cpp.

131 inline PerlModOutput &close(char c = 0) { iclose(c); return *this; }

References iclose and PerlModOutput.

Referenced by closeHash and closeList.

closeHash()

PerlModOutput & PerlModOutput::closeHash ()
inline

Definition at line 149 of file perlmodgen.cpp.

149 inline PerlModOutput &closeHash() { close('}'); return *this; }

References close and PerlModOutput.

Referenced by addPerlModDocBlock and addTemplateArgumentList.

closeList()

PerlModOutput & PerlModOutput::closeList ()
inline

Definition at line 147 of file perlmodgen.cpp.

147 inline PerlModOutput &closeList() { close(']'); return *this; }

References close and PerlModOutput.

Referenced by addTemplateArgumentList.

continueBlock()

PerlModOutput & PerlModOutput::continueBlock ()
inline

Definition at line 103 of file perlmodgen.cpp.

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

References indent, m_blockstart, m_stream and PerlModOutput.

Referenced by iaddField and iopen.

indent()

PerlModOutput & PerlModOutput::indent ()
inline

Definition at line 121 of file perlmodgen.cpp.

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

References m_pretty, m_spaces, m_stream and PerlModOutput.

Referenced by continueBlock and iclose.

open()

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

Definition at line 130 of file perlmodgen.cpp.

130 inline PerlModOutput &open(char c, const QCString &s = QCString()) { iopen(c, s); return *this; }

References iopen and PerlModOutput.

Referenced by openHash and openList.

openHash()

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

Definition at line 148 of file perlmodgen.cpp.

148 inline PerlModOutput &openHash(const QCString &s = QCString() ) { open('{', s); return *this; }

References open and PerlModOutput.

Referenced by addPerlModDocBlock and addTemplateArgumentList.

openList()

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

Definition at line 146 of file perlmodgen.cpp.

146 inline PerlModOutput &openList(const QCString &s = QCString()) { open('[', s); return *this; }

References open and PerlModOutput.

Referenced by addTemplateArgumentList.

reset()

void PerlModOutput::reset ()
inline

Definition at line 96 of file perlmodgen.cpp.

96 void reset() { m_stream=nullptr; }

References m_stream and reset.

Referenced by reset and ~PerlModOutput.

setPerlModOutputStream()

void PerlModOutput::setPerlModOutputStream (PerlModOutputStream * os)
inline

Definition at line 98 of file perlmodgen.cpp.

Reference m_stream.

Protected Member Functions

decIndent()

void PerlModOutput::decIndent ()
protected

Definition at line 157 of file perlmodgen.cpp.

References m_indentation, m_spaces and PERLOUTPUT_MAX_INDENTATION.

Referenced by iclose.

iaddField()

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

Definition at line 162 of file perlmodgen.cpp.

224{
226 m_stream->add(s);
227 m_stream->add(m_pretty ? " => " : "=>");
228}

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 160 of file perlmodgen.cpp.

230void PerlModOutput::iaddFieldQuotedChar(const QCString &field, char content)
231{
232 iaddField(field);
233 m_stream->add('\'');
234 if ((content == '\'') || (content == '\\'))
235 m_stream->add('\\');
236 m_stream->add(content);
237 m_stream->add('\'');
238}

References iaddField and m_stream.

Referenced by addFieldQuotedChar.

iaddFieldQuotedString()

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

Definition at line 161 of file perlmodgen.cpp.

240void PerlModOutput::iaddFieldQuotedString(const QCString &field, const QCString &content)
241{
242 if (content == nullptr)
243 return;
244 iaddField(field);
245 m_stream->add('\'');
246 iaddQuoted(content);
247 m_stream->add('\'');
248}

References iaddField, iaddQuoted and m_stream.

Referenced by addFieldQuotedString.

iaddQuoted()

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

Definition at line 159 of file perlmodgen.cpp.

209{
210 if (str.isEmpty()) return;
211 const char *s = str.data();
212 char c = 0;
213 while ((c = *s++) != 0)
214 {
215 if ((c == '\'') || (c == '\\'))
216 {
217 m_stream->add('\\');
218 }
219 m_stream->add(c);
220 }
221}

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

Referenced by addQuoted and iaddFieldQuotedString.

iclose()

void PerlModOutput::iclose (char c)
protected

Definition at line 165 of file perlmodgen.cpp.

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

References decIndent, indent, m_blockstart and m_stream.

Referenced by close.

incIndent()

void PerlModOutput::incIndent ()
protected

Definition at line 156 of file perlmodgen.cpp.

192{
194 {
195 char *s = &m_spaces[m_indentation * 2];
196 *s++ = ' '; *s++ = ' '; *s = 0;
197 }
199}

References m_indentation, m_spaces and PERLOUTPUT_MAX_INDENTATION.

Referenced by iopen.

iopen()

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

Definition at line 164 of file perlmodgen.cpp.

250void PerlModOutput::iopen(char c, const QCString &s)
251{
252 if (s != nullptr)
253 iaddField(s);
254 else
256 m_stream->add(c);
257 incIndent();
258 m_blockstart = true;
259}

References continueBlock, iaddField, incIndent, m_blockstart and m_stream.

Referenced by open.

Public Member Attributes

m_pretty

bool PerlModOutput::m_pretty

Definition at line 85 of file perlmodgen.cpp.

85 bool m_pretty;

Referenced by iaddField, indent and PerlModOutput.

Private Member Attributes

m_blockstart

bool PerlModOutput::m_blockstart

Definition at line 171 of file perlmodgen.cpp.

Referenced by continueBlock, iclose, iopen and PerlModOutput.

m_indentation

int PerlModOutput::m_indentation

Definition at line 170 of file perlmodgen.cpp.

Referenced by decIndent, incIndent and PerlModOutput.

m_spaces

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

Definition at line 174 of file perlmodgen.cpp.

Referenced by decIndent, incIndent, indent and PerlModOutput.

m_stream

PerlModOutputStream* PerlModOutput::m_stream

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


Generated via doxygen2docusaurus by Doxygen 1.14.0.