OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
StdCompilerINIWrite Class Reference

#include <StdCompiler.h>

Inheritance diagram for StdCompilerINIWrite:
[legend]
Collaboration diagram for StdCompilerINIWrite:
[legend]

Classes

struct  Naming
 

Public Types

typedef StdStrBuf OutT
 
enum  Sep {
  SEP_NONE =0, SEP_SEP, SEP_SEP2, SEP_SET,
  SEP_PART, SEP_PART2, SEP_PLUS, SEP_START,
  SEP_END, SEP_START2, SEP_END2, SEP_VLINE,
  SEP_DOLLAR
}
 
enum  RawCompileType {
  RCT_Escaped =0, RCT_All, RCT_Idtf, RCT_IdtfAllowEmpty,
  RCT_ID
}
 
typedef void(* WarnCBT )(void *, const char *, const char *)
 

Public Member Functions

OutT getOutput ()
 
virtual bool hasNaming () override
 
virtual bool Name (const char *szName) override
 
virtual void NameEnd (bool fBreak=false) override
 
virtual bool Separator (Sep eSep) override
 
virtual void DWord (int32_t &rInt) override
 
virtual void DWord (uint32_t &rInt) override
 
virtual void Word (int16_t &rShort) override
 
virtual void Word (uint16_t &rShort) override
 
virtual void Byte (int8_t &rByte) override
 
virtual void Byte (uint8_t &rByte) override
 
virtual void Boolean (bool &rBool) override
 
virtual void Character (char &rChar) override
 
virtual void String (char *szString, size_t iMaxLength, RawCompileType eType=RCT_Escaped) override
 
virtual void String (char **pszString, RawCompileType eType=RCT_Escaped) override
 
virtual void String (std::string &str, RawCompileType eType=RCT_Escaped) override
 
virtual void Raw (void *pData, size_t iSize, RawCompileType eType=RCT_Escaped) override
 
virtual void Begin () override
 
virtual void End () override
 
virtual bool isDoublePass ()
 
virtual bool isDeserializer ()
 
bool isSerializer ()
 
virtual bool isVerbose ()
 
virtual bool isRegistry ()
 
virtual void setRuntimeWritesAllowed (int32_t iChange)
 
virtual const char * GetNameByIndex (size_t idx) const
 
virtual bool FollowName (const char *szName)
 
virtual bool Default (const char *szName)
 
virtual int NameCount (const char *szName=nullptr)
 
virtual void NoSeparator ()
 
virtual StdStrBuf getPosition () const
 
virtual void BeginSecond ()
 
template<class T >
void Value (const T &rStruct)
 
template<class T >
void Value (T &rStruct)
 
void Value (int32_t &rInt)
 
void Value (uint32_t &rInt)
 
void Value (int16_t &rInt)
 
void Value (uint16_t &rInt)
 
void Value (int8_t &rInt)
 
void Value (uint8_t &rInt)
 
void Value (bool &rBool)
 
template<class T >
void Compile (T &&rStruct)
 
template<class T >
void Decompile (const T &rStruct)
 
void excNotFound (const char *szMessage,...)
 
void excEOF (const char *szMessage="EOF",...)
 
void excCorrupt (const char *szMessage,...)
 
void setWarnCallback (WarnCBT pnWarnCB, void *pData)
 
void Warn (const char *szWarning,...)
 

Protected Member Functions

void PrepareForValue ()
 
void WriteEscaped (const char *szString, const char *pEnd)
 
void WriteIndent (bool fSectionName)
 
void PutName (bool fSection)
 
template<class T >
void DoCompilation (T &rStruct)
 

Static Protected Member Functions

static char SeparatorToChar (Sep eSep)
 
static bool IsStringEnd (char c, RawCompileType eType)
 

Protected Attributes

StdStrBuf Buf
 
NamingpNaming
 
int iDepth
 
bool fPutName
 
bool fInSection
 

Detailed Description

Definition at line 568 of file StdCompiler.h.


Class Documentation

struct StdCompilerINIWrite::Naming

Definition at line 609 of file StdCompiler.h.

Collaboration diagram for StdCompilerINIWrite::Naming:
[legend]
Class Members
StdStrBuf Name
Naming * Parent

Member Typedef Documentation

Definition at line 572 of file StdCompiler.h.

typedef void(* StdCompiler::WarnCBT)(void *, const char *, const char *)
inherited

Definition at line 291 of file StdCompiler.h.

Member Enumeration Documentation

Enumerator
RCT_Escaped 
RCT_All 
RCT_Idtf 
RCT_IdtfAllowEmpty 
RCT_ID 

Definition at line 145 of file StdCompiler.h.

146  {
147  RCT_Escaped=0,// Any data allowed, no separator needed (default)
148  RCT_All, // Printable characters only, must be last element in naming.
149  RCT_Idtf, // Alphanumerical characters or '_', separator needed.
150  RCT_IdtfAllowEmpty, // Like RCT_Idtf, but empty strings are also allowed
151  RCT_ID // Like RCT_Idtf (only used for special compilers that treat IDs differently)
152  };
enum StdCompiler::Sep
inherited
Enumerator
SEP_NONE 
SEP_SEP 
SEP_SEP2 
SEP_SET 
SEP_PART 
SEP_PART2 
SEP_PLUS 
SEP_START 
SEP_END 
SEP_START2 
SEP_END2 
SEP_VLINE 
SEP_DOLLAR 

Definition at line 113 of file StdCompiler.h.

114  {
115  SEP_NONE=0, // No separator ("")
116  SEP_SEP, // Array separation (",")
117  SEP_SEP2, // Array separation 2 (";")
118  SEP_SET, // Map pair separation ("=")
119  SEP_PART, // Value part separation (".")
120  SEP_PART2, // Value part separation 2 (":")
121  SEP_PLUS, // Value separation with a '+' char ("+")
122  SEP_START, // Start some sort of list ('(')
123  SEP_END, // End some sort of list ('(')
124  SEP_START2, // Start some sort of list ('[')
125  SEP_END2, // End some sort of list (']')
126  SEP_VLINE, // Vertical line separator ('|')
127  SEP_DOLLAR // Dollar sign ('$')
128  };

Member Function Documentation

void StdCompilerINIWrite::Begin ( )
overridevirtual

Reimplemented from StdCompiler.

Definition at line 355 of file StdCompiler.cpp.

References Buf, StdStrBuf::Clear(), fInSection, fPutName, iDepth, and pNaming.

356 {
357  pNaming = nullptr;
358  fPutName = false;
359  iDepth = 0;
360  fInSection = false;
361  Buf.Clear();
362 }
void Clear()
Definition: StdBuf.h:474

Here is the call graph for this function:

virtual void StdCompiler::BeginSecond ( )
inlinevirtualinherited

Reimplemented in StdCompilerBinWrite.

Definition at line 165 of file StdCompiler.h.

Referenced by StdCompiler::DoCompilation().

165 { }

Here is the caller graph for this function:

void StdCompilerINIWrite::Boolean ( bool &  rBool)
overridevirtual

Implements StdCompiler.

Definition at line 302 of file StdCompiler.cpp.

References StdStrBuf::Append(), Buf, and PrepareForValue().

303 {
304  PrepareForValue();
305  Buf.Append(rBool ? "true" : "false");
306 }
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:527

Here is the call graph for this function:

void StdCompilerINIWrite::Byte ( int8_t &  rByte)
overridevirtual

Implements StdCompiler.

Definition at line 292 of file StdCompiler.cpp.

References StdStrBuf::AppendFormat(), Buf, and PrepareForValue().

293 {
294  PrepareForValue();
295  Buf.AppendFormat("%d", rByte);
296 }
void AppendFormat(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:197

Here is the call graph for this function:

void StdCompilerINIWrite::Byte ( uint8_t &  rByte)
overridevirtual

Implements StdCompiler.

Definition at line 297 of file StdCompiler.cpp.

References StdStrBuf::AppendFormat(), Buf, and PrepareForValue().

298 {
299  PrepareForValue();
300  Buf.AppendFormat("%u", rInt);
301 }
void AppendFormat(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:197

Here is the call graph for this function:

void StdCompilerINIWrite::Character ( char &  rChar)
overridevirtual

Implements StdCompiler.

Definition at line 307 of file StdCompiler.cpp.

References StdStrBuf::AppendFormat(), Buf, and PrepareForValue().

308 {
309  PrepareForValue();
310  Buf.AppendFormat("%c", rChar);
311 }
void AppendFormat(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:197

Here is the call graph for this function:

template<class T >
void StdCompiler::Compile ( T &&  rStruct)
inlineinherited

Definition at line 183 of file StdCompiler.h.

References StdCompiler::DoCompilation(), and StdCompiler::isDeserializer().

Referenced by C4Config::Default(), C4GameParameters::Load(), C4Config::Load(), C4ConfigGamepad::Reset(), and C4ConfigGamepad::ResetButtons().

184  {
185  assert(isDeserializer());
186  DoCompilation(rStruct);
187  }
void DoCompilation(T &rStruct)
Definition: StdCompiler.h:198
virtual bool isDeserializer()
Definition: StdCompiler.h:63

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
void StdCompiler::Decompile ( const T &  rStruct)
inlineinherited

Definition at line 188 of file StdCompiler.h.

References StdCompiler::DoCompilation(), and StdCompiler::isDeserializer().

Referenced by GetValByStdCompiler(), and C4Config::Save().

189  {
190  assert(!isDeserializer());
191  DoCompilation(const_cast<T &>(rStruct));
192  }
void DoCompilation(T &rStruct)
Definition: StdCompiler.h:198
virtual bool isDeserializer()
Definition: StdCompiler.h:63

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool StdCompiler::Default ( const char *  szName)
inlinevirtualinherited

Reimplemented in C4ValueCompiler.

Definition at line 98 of file StdCompiler.h.

Referenced by StdNamingDefaultAdapt< T, D >::CompileFunc(), C4ConfigControls::CompileFunc(), and C4PlayerControlAssignmentSets::CompileFunc().

98 { return true; }

Here is the caller graph for this function:

template<class T >
void StdCompiler::DoCompilation ( T &  rStruct)
inlineprotectedinherited

Definition at line 198 of file StdCompiler.h.

References StdCompiler::Begin(), StdCompiler::BeginSecond(), StdCompiler::End(), StdCompiler::isDoublePass(), and StdCompiler::Value().

Referenced by StdCompiler::Compile(), and StdCompiler::Decompile().

199  {
200  // Start compilation, do first pass
201  Begin();
202  Value(rStruct);
203  // Second pass needed?
204  if (isDoublePass())
205  {
206  BeginSecond();
207  Value(rStruct);
208  }
209  // Finish
210  End();
211  }
virtual void End()
Definition: StdCompiler.h:166
virtual bool isDoublePass()
Definition: StdCompiler.h:60
void Value(const T &rStruct)
Definition: StdCompiler.h:171
virtual void Begin()
Definition: StdCompiler.h:164
virtual void BeginSecond()
Definition: StdCompiler.h:165

Here is the call graph for this function:

Here is the caller graph for this function:

void StdCompilerINIWrite::DWord ( int32_t &  rInt)
overridevirtual

Implements StdCompiler.

Definition at line 272 of file StdCompiler.cpp.

References StdStrBuf::AppendFormat(), Buf, and PrepareForValue().

273 {
274  PrepareForValue();
275  Buf.AppendFormat("%d", rInt);
276 }
void AppendFormat(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:197

Here is the call graph for this function:

void StdCompilerINIWrite::DWord ( uint32_t &  rInt)
overridevirtual

Implements StdCompiler.

Definition at line 277 of file StdCompiler.cpp.

References StdStrBuf::AppendFormat(), Buf, and PrepareForValue().

278 {
279  PrepareForValue();
280  Buf.AppendFormat("%u", rInt);
281 }
void AppendFormat(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:197

Here is the call graph for this function:

void StdCompilerINIWrite::End ( )
overridevirtual

Reimplemented from StdCompiler.

Definition at line 364 of file StdCompiler.cpp.

References iDepth.

365 {
366  // Ensure all namings were closed properly
367  assert(!iDepth);
368 }
void StdCompiler::excCorrupt ( const char *  szMessage,
  ... 
)
inlineinherited

Definition at line 259 of file StdCompiler.h.

References FormatStringV(), and StdCompiler::getPosition().

Referenced by C4MeshDenumerator::CompileFunc(), C4Network2ResCore::CompileFunc(), C4RoundResultsPlayers::CompileFunc(), C4DefGraphicsAdapt::CompileFunc(), C4Network2ResChunkData::CompileFunc(), C4Value::CompileFunc(), C4PropListNumbered::CompileFunc(), C4KeyCodeEx::CompileFunc(), StdSubMeshInstance::CompileFunc(), C4IDPacket::CompileFunc(), C4ClientPlayerInfos::CompileFunc(), StdMeshInstanceAnimationNode::CompileFunc(), C4PlayerInfoList::CompileFunc(), StdMeshInstance::CompileFunc(), C4ValueNumbers::CompileValue(), C4PropListStatic::RefCompileFunc(), and StdCompilerBinRead::String().

260  {
261  // Throw the appropriate exception
262  va_list args; va_start(args, szMessage);
263  throw new CorruptException(getPosition(), FormatStringV(szMessage, args));
264  }
virtual StdStrBuf getPosition() const
Definition: StdCompiler.h:161
StdStrBuf FormatStringV(const char *szFmt, va_list args)
Definition: StdBuf.cpp:283

Here is the call graph for this function:

Here is the caller graph for this function:

void StdCompiler::excEOF ( const char *  szMessage = "EOF",
  ... 
)
inlineinherited

Definition at line 253 of file StdCompiler.h.

References FormatStringV(), and StdCompiler::getPosition().

Referenced by StdCompilerBinRead::Raw(), StdCompilerBinRead::ReadValue(), and StdCompilerBinRead::String().

254  {
255  // Throw the appropriate exception
256  va_list args; va_start(args, szMessage);
257  throw new EOFException(getPosition(), FormatStringV(szMessage, args));
258  }
virtual StdStrBuf getPosition() const
Definition: StdCompiler.h:161
StdStrBuf FormatStringV(const char *szFmt, va_list args)
Definition: StdBuf.cpp:283

Here is the call graph for this function:

Here is the caller graph for this function:

void StdCompiler::excNotFound ( const char *  szMessage,
  ... 
)
inlineinherited

Definition at line 243 of file StdCompiler.h.

References FormatStringV(), and StdCompiler::getPosition().

Referenced by C4ScenarioParameterDef::Option::CompileFunc(), C4PlayerControlDef::CompileFunc(), C4ScenarioParameterDef::CompileFunc(), C4PlayerControlAssignment::CompileFunc(), C4Object::CompileFunc(), C4PlayerControlAssignmentSet::CompileFunc(), StdHexAdapt::CompileFunc(), and StdCompilerINIRead::notFound().

244  {
245 #ifdef STDCOMPILER_EXCEPTION_WORKAROUND
246  // Exception workaround: Just set a flag in failesafe mode.
247  if (fFailSafe) { fFail = true; return; }
248 #endif
249  // Throw the appropriate exception
250  va_list args; va_start(args, szMessage);
251  throw new NotFoundException(getPosition(), FormatStringV(szMessage, args));
252  }
virtual StdStrBuf getPosition() const
Definition: StdCompiler.h:161
StdStrBuf FormatStringV(const char *szFmt, va_list args)
Definition: StdBuf.cpp:283

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool StdCompiler::FollowName ( const char *  szName)
inlinevirtualinherited

Reimplemented in StdCompilerINIRead.

Definition at line 94 of file StdCompiler.h.

References StdCompiler::Name(), and StdCompiler::NameEnd().

Referenced by C4Object::CompileFunc().

94 { NameEnd(); return Name(szName); }
virtual bool Name(const char *szName)
Definition: StdCompiler.h:87
virtual void NameEnd(bool fBreak=false)
Definition: StdCompiler.h:88

Here is the call graph for this function:

Here is the caller graph for this function:

virtual const char* StdCompiler::GetNameByIndex ( size_t  idx) const
inlinevirtualinherited

Reimplemented in StdCompilerINIRead.

Definition at line 89 of file StdCompiler.h.

Referenced by C4ScenarioParameters::CompileFunc().

89 { return nullptr; }

Here is the caller graph for this function:

OutT StdCompilerINIWrite::getOutput ( )
inline

Definition at line 573 of file StdCompiler.h.

References Buf.

573 { return Buf; }
virtual StdStrBuf StdCompiler::getPosition ( ) const
inlinevirtualinherited

Reimplemented in StdCompilerINIRead, and StdCompilerBinRead.

Definition at line 161 of file StdCompiler.h.

Referenced by StdCompiler::excCorrupt(), StdCompiler::excEOF(), StdCompiler::excNotFound(), and StdCompiler::Warn().

161 { return StdStrBuf(); }

Here is the caller graph for this function:

virtual bool StdCompilerINIWrite::hasNaming ( )
inlineoverridevirtual

Reimplemented from StdCompiler.

Definition at line 576 of file StdCompiler.h.

576 { return true; }
virtual bool StdCompiler::isDeserializer ( )
inlinevirtualinherited

Reimplemented in C4ValueCompiler, StdCompilerINIRead, StdCompilerBinRead, and StdCompilerNull.

Definition at line 63 of file StdCompiler.h.

Referenced by StdCompiler::Compile(), C4MeshDenumerator::CompileFunc(), C4GameVersion::CompileFunc(), C4ObjectPtr::CompileFunc(), C4NameList::CompileFunc(), C4NetFilenameAdapt::CompileFunc(), C4Property::CompileFunc(), C4ObjectInfoCore::CompileFunc(), C4StrValAdapt< T >::CompileFunc(), C4GameRes::CompileFunc(), C4Network2Address::CompileFunc(), C4MaterialReaction::CompileFunc(), C4ValueProviderLinear::CompileFunc(), C4ValueArray::CompileFunc(), C4ValueMapData::CompileFunc(), ValidatedStdCopyStrBufBase::CompileFunc(), C4Team::CompileFunc(), C4SHead::CompileFunc(), C4Scoreboard::CompileFunc(), C4GameResList::CompileFunc(), C4Command::CompileFunc(), StdNamingDefaultAdapt< T, D >::CompileFunc(), C4RoundResultsPlayers::CompileFunc(), C4DrawTransform::CompileFunc(), C4MusicSystem::CompileFunc(), C4PlayerInfoCore::CompileFunc(), C4PlayerControlDefs::CompileFunc(), C4ScenarioParameters::CompileFunc(), C4ObjectList::CompileFunc(), C4Client::CompileFunc(), C4Effect::CompileFunc(), C4PropList::CompileFunc(), C4MaterialCore::CompileFunc(), C4PlayerInfo::CompileFunc(), C4DefGraphicsAdapt::CompileFunc(), C4RoundResults::CompileFunc(), C4Landscape::CompileFunc(), C4Network2ResChunkData::CompileFunc(), C4ClientList::CompileFunc(), C4TeamList::CompileFunc(), C4Player::CompileFunc(), C4Set< T >::CompileFunc(), C4PlayerControlAssignment::CompileFunc(), C4NetIO::EndpointAddress::CompileFunc(), C4GraphicsOverlay::CompileFunc(), C4Value::CompileFunc(), C4Object::CompileFunc(), C4PropListNumbered::CompileFunc(), C4KeyCodeEx::CompileFunc(), StdSubMeshInstance::CompileFunc(), C4IDPacket::CompileFunc(), DisconnectData::CompileFunc(), C4GraphicsOverlayListAdapt::CompileFunc(), C4ValueNumbers::CompileFunc(), C4ClientPlayerInfos::CompileFunc(), C4Game::CompileFunc(), C4PacketList::CompileFunc(), StdArrayDefaultAdapt< T, D, M >::CompileFunc(), StdBuf::CompileFunc(), StdMeshInstanceAnimationNode::CompileFunc(), C4MapFolderData::CompileFunc(), StdArrayDefaultArrayAdapt< T, D, M >::CompileFunc(), C4PlayerInfoList::CompileFunc(), C4PacketPostMortem::CompileFunc(), StdMeshInstance::AttachedMesh::CompileFunc(), C4KeyboardInput::CompileFunc(), StdMeshInstance::CompileFunc(), StdSTLContainerAdapt< C >::CompileFunc(), StdStrBuf::CompileFunc(), StdIntPackAdapt< T >::CompileFunc(), StdEnumAdapt< T, int_t >::CompileFunc(), StdBitfieldAdapt< T >::CompileFunc(), StdNamingCountAdapt< int_t >::CompileFunc(), StdHexAdapt::CompileFunc(), C4ValueNumbers::CompileValue(), StdCompiler::Decompile(), StdCompiler::isSerializer(), C4PropListStatic::RefCompileFunc(), StdPtrAdaptCompileFunc(), and unpack_class< T >::unpack().

63 { return false; }
virtual bool StdCompiler::isDoublePass ( )
inlinevirtualinherited

Reimplemented in StdCompilerBinWrite.

Definition at line 60 of file StdCompiler.h.

Referenced by StdCompiler::DoCompilation().

60 { return false; }

Here is the caller graph for this function:

virtual bool StdCompiler::isRegistry ( )
inlinevirtualinherited

Definition at line 75 of file StdCompiler.h.

Referenced by C4PlayerControlAssignmentSets::CompileFunc().

75 { return false; }

Here is the caller graph for this function:

bool StdCompiler::isSerializer ( )
inlineinherited

Definition at line 64 of file StdCompiler.h.

References StdCompiler::isDeserializer().

Referenced by C4NetFilenameAdapt::CompileFunc(), C4ID::CompileFunc(), C4Command::CompileFunc(), StdNamingDefaultAdapt< T, D >::CompileFunc(), C4ObjectList::CompileFunc(), C4Effect::CompileFunc(), C4FoWLightSection::CompileFunc(), StdDecompileAdapt< T >::CompileFunc(), C4PlayerInfo::CompileFunc(), C4ConfigControls::CompileFunc(), C4Game::CompileFunc(), and C4PlayerControlAssignmentSets::CompileFunc().

64 { return !isDeserializer(); }
virtual bool isDeserializer()
Definition: StdCompiler.h:63

Here is the call graph for this function:

Here is the caller graph for this function:

bool StdCompiler::IsStringEnd ( char  c,
RawCompileType  eType 
)
staticprotectedinherited

Definition at line 58 of file StdCompiler.cpp.

References StdCompiler::RCT_All, StdCompiler::RCT_Escaped, StdCompiler::RCT_ID, StdCompiler::RCT_Idtf, and StdCompiler::RCT_IdtfAllowEmpty.

Referenced by StdCompilerINIRead::TestStringEnd().

59 {
60  switch (eType)
61  {
62  case RCT_Escaped: return c == '"' || !c || c == '\n' || c == '\r';
63  case RCT_All: return !c || c == '\n' || c == '\r';
64  // '-' is needed for Layers in Scenario.txt (C4NameList) and other Material-Texture combinations
65  case RCT_Idtf: case RCT_IdtfAllowEmpty: case RCT_ID: return !isalnum((unsigned char)c) && c != '_' && c != '-';
66  }
67  // unreachable
68  return true;
69 }

Here is the caller graph for this function:

virtual bool StdCompiler::isVerbose ( )
inlinevirtualinherited

Reimplemented in C4ValueCompiler.

Definition at line 72 of file StdCompiler.h.

References StdCompiler::hasNaming().

Referenced by StdEnumAdapt< T, int_t >::CompileFunc(), StdBitfieldAdapt< T >::CompileFunc(), and StdHexAdapt::CompileFunc().

72 { return hasNaming(); }
virtual bool hasNaming()
Definition: StdCompiler.h:68

Here is the call graph for this function:

Here is the caller graph for this function:

bool StdCompilerINIWrite::Name ( const char *  szName)
overridevirtual

Reimplemented from StdCompiler.

Definition at line 223 of file StdCompiler.cpp.

References StdStrBuf::Copy(), fInSection, fPutName, iDepth, StdCompilerINIWrite::Naming::Name, StdCompilerINIWrite::Naming::Parent, pNaming, and PutName().

224 {
225  // Sub-Namesections exist, so it's a section. Write name if not already done so.
226  if (fPutName) PutName(true);
227  // Push struct
228  Naming *pnNaming = new Naming;
229  pnNaming->Name.Copy(szName);
230  pnNaming->Parent = pNaming;
231  pNaming = pnNaming;
232  iDepth++;
233  // Done
234  fPutName = true; fInSection = false;
235  return true;
236 }
void PutName(bool fSection)

Here is the call graph for this function:

virtual int StdCompiler::NameCount ( const char *  szName = nullptr)
inlinevirtualinherited

Reimplemented in StdCompilerINIRead, and StdCompilerNull.

Definition at line 101 of file StdCompiler.h.

Referenced by C4ScenarioParameters::CompileFunc(), and StdNamingCountAdapt< int_t >::CompileFunc().

101 { assert(false); return 0; }

Here is the caller graph for this function:

void StdCompilerINIWrite::NameEnd ( bool  fBreak = false)
overridevirtual

Reimplemented from StdCompiler.

Definition at line 238 of file StdCompiler.cpp.

References StdStrBuf::Append(), Buf, fInSection, fPutName, iDepth, StdCompilerINIWrite::Naming::Parent, and pNaming.

239 {
240  // Append newline
241  if (!fPutName && !fInSection)
242  Buf.Append("\r\n");
243  fPutName = false;
244  // Note this makes it impossible to distinguish an empty name section from
245  // a non-existing name section.
246 
247  // Pop
248  assert(iDepth);
249  Naming *poNaming = pNaming;
250  pNaming = poNaming->Parent;
251  delete poNaming;
252  iDepth--;
253  // We're inside a section now
254  fInSection = true;
255 }
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:527

Here is the call graph for this function:

virtual void StdCompiler::NoSeparator ( )
inlinevirtualinherited

Reimplemented in StdCompilerINIRead.

Definition at line 130 of file StdCompiler.h.

Referenced by C4Command::CompileFunc(), and C4KeyCodeEx::CompileFunc().

130 { }

Here is the caller graph for this function:

void StdCompilerINIWrite::PrepareForValue ( )
protected

Definition at line 370 of file StdCompiler.cpp.

References fInSection, fPutName, iDepth, and PutName().

Referenced by Boolean(), Byte(), Character(), DWord(), Separator(), String(), and Word().

371 {
372  // Put name (value-type), if not already done so
373  if (fPutName) PutName(false);
374  // No data allowed inside of sections
375  assert(!fInSection);
376  // No values allowed on top-level - must be contained in at least one section
377  assert(iDepth > 1);
378 }
void PutName(bool fSection)

Here is the call graph for this function:

Here is the caller graph for this function:

void StdCompilerINIWrite::PutName ( bool  fSection)
protected

Definition at line 430 of file StdCompiler.cpp.

References StdStrBuf::Append(), StdStrBuf::AppendFormat(), Buf, fPutName, StdStrBuf::getData(), StdStrBuf::getLength(), StdCompilerINIWrite::Naming::Name, pNaming, and WriteIndent().

Referenced by Name(), PrepareForValue(), and Separator().

431 {
432  if (fSection && Buf.getLength())
433  Buf.Append("\r\n");
434  WriteIndent(fSection);
435  // Put name
436  if (fSection)
437  Buf.AppendFormat("[%s]\r\n", pNaming->Name.getData());
438  else
439  Buf.AppendFormat("%s=", pNaming->Name.getData());
440  // Set flag
441  fPutName = false;
442 }
const char * getData() const
Definition: StdBuf.h:450
void WriteIndent(bool fSectionName)
void AppendFormat(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:197
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:527
size_t getLength() const
Definition: StdBuf.h:453

Here is the call graph for this function:

Here is the caller graph for this function:

void StdCompilerINIWrite::Raw ( void *  pData,
size_t  iSize,
RawCompileType  eType = RCT_Escaped 
)
overridevirtual

Implements StdCompiler.

Definition at line 335 of file StdCompiler.cpp.

References StdStrBuf::Append(), Buf, StdCompiler::RCT_All, StdCompiler::RCT_Escaped, StdCompiler::RCT_ID, StdCompiler::RCT_Idtf, StdCompiler::RCT_IdtfAllowEmpty, and WriteEscaped().

Referenced by String().

336 {
337  switch (eType)
338  {
339  case RCT_Escaped:
340  WriteEscaped(reinterpret_cast<char *>(pData), reinterpret_cast<char *>(pData) + iSize);
341  break;
342  case RCT_All:
343  case RCT_Idtf:
344  case RCT_IdtfAllowEmpty:
345  case RCT_ID:
346  Buf.Append(reinterpret_cast<char *>(pData), iSize);
347  }
348 }
void WriteEscaped(const char *szString, const char *pEnd)
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:527
int iSize
Definition: TstC4NetIO.cpp:35

Here is the call graph for this function:

Here is the caller graph for this function:

bool StdCompilerINIWrite::Separator ( Sep  eSep)
overridevirtual

Reimplemented from StdCompiler.

Definition at line 257 of file StdCompiler.cpp.

References StdStrBuf::AppendChar(), Buf, fInSection, PrepareForValue(), PutName(), and StdCompiler::SeparatorToChar().

258 {
259  if (fInSection)
260  {
261  // Re-put section name
262  PutName(true);
263  }
264  else
265  {
266  PrepareForValue();
268  }
269  return true;
270 }
void AppendChar(char cChar)
Definition: StdBuf.h:596
static char SeparatorToChar(Sep eSep)
Definition: StdCompiler.cpp:37
void PutName(bool fSection)

Here is the call graph for this function:

char StdCompiler::SeparatorToChar ( Sep  eSep)
staticprotectedinherited

Definition at line 37 of file StdCompiler.cpp.

References StdCompiler::SEP_DOLLAR, StdCompiler::SEP_END, StdCompiler::SEP_END2, StdCompiler::SEP_PART, StdCompiler::SEP_PART2, StdCompiler::SEP_PLUS, StdCompiler::SEP_SEP, StdCompiler::SEP_SEP2, StdCompiler::SEP_SET, StdCompiler::SEP_START, StdCompiler::SEP_START2, and StdCompiler::SEP_VLINE.

Referenced by Separator(), and StdCompilerINIRead::Separator().

38 {
39  switch (eSep)
40  {
41  case SEP_SEP: return ',';
42  case SEP_SEP2: return ';';
43  case SEP_SET: return '=';
44  case SEP_PART: return '.';
45  case SEP_PART2: return ':';
46  case SEP_PLUS: return '+';
47  case SEP_START: return '(';
48  case SEP_END: return ')';
49  case SEP_START2: return '[';
50  case SEP_END2: return ']';
51  case SEP_VLINE: return '|';
52  case SEP_DOLLAR: return '$';
53  default: assert(!"Unhandled Separator value");
54  }
55  return ' ';
56 }

Here is the caller graph for this function:

virtual void StdCompiler::setRuntimeWritesAllowed ( int32_t  iChange)
inlinevirtualinherited

Definition at line 78 of file StdCompiler.h.

Referenced by StdRuntimeValueAdapt< T >::CompileFunc().

78 { }

Here is the caller graph for this function:

void StdCompiler::setWarnCallback ( WarnCBT  pnWarnCB,
void *  pData 
)
inlineinherited

Definition at line 292 of file StdCompiler.h.

292 { pWarnCB = pnWarnCB; pWarnData = pData; }
void StdCompilerINIWrite::String ( char *  szString,
size_t  iMaxLength,
RawCompileType  eType = RCT_Escaped 
)
overridevirtual

Implements StdCompiler.

Definition at line 313 of file StdCompiler.cpp.

References StdStrBuf::Append(), Buf, PrepareForValue(), StdCompiler::RCT_All, StdCompiler::RCT_Escaped, StdCompiler::RCT_ID, StdCompiler::RCT_Idtf, StdCompiler::RCT_IdtfAllowEmpty, and WriteEscaped().

Referenced by String().

314 {
315  PrepareForValue();
316  switch (eType)
317  {
318  case RCT_Escaped:
319  WriteEscaped(szString, szString + strlen(szString));
320  break;
321  case RCT_All:
322  case RCT_Idtf:
323  case RCT_IdtfAllowEmpty:
324  case RCT_ID:
325  Buf.Append(szString);
326  }
327 }
void WriteEscaped(const char *szString, const char *pEnd)
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:527

Here is the call graph for this function:

Here is the caller graph for this function:

void StdCompilerINIWrite::String ( char **  pszString,
RawCompileType  eType = RCT_Escaped 
)
overridevirtual

Implements StdCompiler.

Definition at line 329 of file StdCompiler.cpp.

References String().

330 {
331  char cNull = '\0';
332  String(*pszString ? *pszString : &cNull, 0, eType);
333 }
virtual void String(char *szString, size_t iMaxLength, RawCompileType eType=RCT_Escaped) override

Here is the call graph for this function:

void StdCompilerINIWrite::String ( std::string &  str,
RawCompileType  eType = RCT_Escaped 
)
overridevirtual

Implements StdCompiler.

Definition at line 350 of file StdCompiler.cpp.

References Raw().

351 {
352  Raw(&str[0], str.size(), type);
353 }
virtual void Raw(void *pData, size_t iSize, RawCompileType eType=RCT_Escaped) override

Here is the call graph for this function:

template<class T >
void StdCompiler::Value ( const T &  rStruct)
inlineinherited

Definition at line 171 of file StdCompiler.h.

Referenced by C4FolderHead::CompileFunc(), C4MeshDenumerator::CompileFunc(), C4NetpuncherID::CompileFunc(), C4UpdatePackageCore::CompileFunc(), C4GameVersion::CompileFunc(), C4SVal::CompileFunc(), C4ObjectPtr::CompileFunc(), C4Folder::CompileFunc(), C4NameList::CompileFunc(), C4Sky::CompileFunc(), StdDefaultAdapt< T, D >::CompileFunc(), C4GameLobby::C4PacketCountdown::CompileFunc(), C4Weather::CompileFunc(), C4LSector::CompileFunc(), C4NetFilenameAdapt::CompileFunc(), C4Property::CompileFunc(), C4ScenarioParameterDef::Option::CompileFunc(), C4ObjectInfoCore::CompileFunc(), C4ControlPacket::CompileFunc(), C4StrValAdapt< T >::CompileFunc(), C4GameRes::CompileFunc(), C4GameLobby::C4PacketSetScenarioParameter::CompileFunc(), C4Network2Address::CompileFunc(), C4RoundResultsPlayer::CompileFunc(), C4MaterialReaction::CompileFunc(), C4LeagueRequestHead::CompileFunc(), C4ValueProviderLinear::CompileFunc(), C4ValueArray::CompileFunc(), C4PlayerControlDef::CompileFunc(), C4ConfigGeneral::CompileFunc(), C4ValueMapData::CompileFunc(), C4Rect::CompileFunc(), StdNamingAdapt< T >::CompileFunc(), ValidatedStdCopyStrBufBase::CompileFunc(), C4RoundResult::CompileFunc(), C4ParticleDefCore::CompileFunc(), C4Shape::CompileFunc(), C4Team::CompileFunc(), C4LeagueReportDisconnectHead::CompileFunc(), C4ClientCore::CompileFunc(), C4SHead::CompileFunc(), C4ValueProviderX::CompileFunc(), C4ScenarioParameterDef::CompileFunc(), C4Scoreboard::CompileFunc(), C4GameResList::CompileFunc(), C4ConfigDeveloper::CompileFunc(), C4TargetRect::CompileFunc(), C4Action::CompileFunc(), C4Network2Reference::CompileFunc(), C4Control::CompileFunc(), C4Network2Status::CompileFunc(), C4SDefinitions::CompileFunc(), C4LeagueRequestHeadEnd::CompileFunc(), C4Command::CompileFunc(), StdNamingDefaultAdapt< T, D >::CompileFunc(), C4ValueProviderY::CompileFunc(), C4ScenarioParameterDefs::CompileFunc(), C4Network2ResCore::CompileFunc(), C4RoundResultsPlayers::CompileFunc(), C4DrawTransform::CompileFunc(), C4MusicSystem::CompileFunc(), C4PlayerInfoCore::CompileFunc(), C4RecordChunk::CompileFunc(), C4PlayerControlDefs::CompileFunc(), C4ValueProviderR::CompileFunc(), C4ConfigGraphics::CompileFunc(), C4ScenarioParameters::CompileFunc(), C4LeagueResponseHead::CompileFunc(), C4ObjectList::CompileFunc(), C4SGame::CompileFunc(), C4Client::CompileFunc(), C4ConfigSound::CompileFunc(), C4FoWBeam::CompileFunc(), C4Effect::CompileFunc(), C4ValueProviderAbsX::CompileFunc(), C4FoWLightSection::CompileFunc(), StdDecompileAdapt< T >::CompileFunc(), C4PropList::CompileFunc(), C4MaterialCore::CompileFunc(), C4LeagueResponseHeadStart::CompileFunc(), EditorWindowState::CompileFunc(), C4PlayerInfo::CompileFunc(), C4ValueProviderAbsY::CompileFunc(), C4SPlrStart::CompileFunc(), C4Def::CompileFunc(), C4GameParameters::CompileFunc(), C4DefGraphicsAdapt::CompileFunc(), C4LeagueResponseHeadUpdate::CompileFunc(), C4RoundResults::CompileFunc(), StdRuntimeValueAdapt< T >::CompileFunc(), C4ValueProviderDist::CompileFunc(), C4ConfigNetwork::CompileFunc(), C4MessageBoardQuery::CompileFunc(), C4Network2ResChunkData::CompileFunc(), C4Landscape::CompileFunc(), C4LeagueResponseHeadAuthCheck::CompileFunc(), C4ClientList::CompileFunc(), C4ValueProviderXDir::CompileFunc(), C4TeamList::CompileFunc(), C4SLandscape::CompileFunc(), C4Player::CompileFunc(), C4ConfigStartup::CompileFunc(), C4Set< T >::CompileFunc(), C4ConfigLobby::CompileFunc(), C4PlayerControlAssignment::CompileFunc(), C4GameControlPacket::CompileFunc(), C4SWeather::CompileFunc(), C4ValueProviderYDir::CompileFunc(), C4NetIO::EndpointAddress::CompileFunc(), C4GraphicsOverlay::CompileFunc(), C4PacketAddr::CompileFunc(), C4Value::CompileFunc(), C4ConfigIRC::CompileFunc(), C4Object::CompileFunc(), C4SAnimals::CompileFunc(), C4ControlPlayerControl::ControlItem::CompileFunc(), StdIntAdapt< T, int_t >::CompileFunc(), C4PropListNumbered::CompileFunc(), C4ValueProviderRDir::CompileFunc(), C4SEnvironment::CompileFunc(), C4ConfigGamepad::CompileFunc(), C4PacketLeagueRoundResults::CompileFunc(), C4PktBuf::CompileFunc(), C4ConfigControls::CompileFunc(), C4KeyCodeEx::CompileFunc(), C4ValueProviderAbsRDir::CompileFunc(), StdCastAdapt< T, to_t >::CompileFunc(), C4PktDebugRec::CompileFunc(), C4ConfigSecurity::CompileFunc(), C4Scenario::CompileFunc(), C4PacketControlReq::CompileFunc(), C4PlayerControlAssignmentSet::CompileFunc(), C4KeyEventData::CompileFunc(), C4ValueProviderCosR::CompileFunc(), StdSubMeshInstance::CompileFunc(), C4IDPacket::CompileFunc(), DisconnectData::CompileFunc(), C4ValueNumbers::CompileFunc(), C4GraphicsOverlayListAdapt::CompileFunc(), C4PacketControlPkt::CompileFunc(), StdArrayAdapt< T, M >::CompileFunc(), C4ClientPlayerInfos::CompileFunc(), C4Game::CompileFunc(), C4ValueProviderSinR::CompileFunc(), C4PacketExecSyncCtrl::CompileFunc(), C4Config::CompileFunc(), C4PacketPlayerInfoUpdRequest::CompileFunc(), C4ValueProviderCosV::CompileFunc(), C4PacketList::CompileFunc(), C4PlayerControlAssignmentSets::CompileFunc(), C4PacketPlayerInfo::CompileFunc(), C4ValueProviderSinV::CompileFunc(), C4PlayerControlFile::CompileFunc(), StdArrayDefaultAdapt< T, D, M >::CompileFunc(), C4Network2ResChunk::CompileFunc(), C4ValueProviderAction::CompileFunc(), CompileFunc(), StdBuf::CompileFunc(), C4PacketPing::CompileFunc(), StdMeshInstanceAnimationNode::CompileFunc(), C4MapFolderData::CompileFunc(), C4PacketConn::CompileFunc(), C4PlayerControl::CSync::ControlDownState::CompileFunc(), StdArrayDefaultArrayAdapt< T, D, M >::CompileFunc(), C4PacketConnRe::CompileFunc(), C4PlayerControl::CSync::CompileFunc(), C4PacketFwd::CompileFunc(), C4PacketResStatus::CompileFunc(), C4PlayerInfoList::CompileFunc(), C4PlayerControl::CompileFunc(), StdInsertAdapt< T, I >::CompileFunc(), C4PacketResDiscover::CompileFunc(), C4PacketPostMortem::CompileFunc(), C4PacketResRequest::CompileFunc(), C4PacketJoinData::CompileFunc(), C4PacketActivateReq::CompileFunc(), C4CustomKey::CompileFunc(), StdMeshInstance::SerializableValueProvider::CompileFunc(), StdMeshInstance::AttachedMesh::CompileFunc(), C4KeyboardInput::CompileFunc(), StdMeshInstance::CompileFunc(), StdSTLContainerAdapt< C >::CompileFunc(), StdIntPackAdapt< T >::CompileFunc(), StdEnumAdapt< T, int_t >::CompileFunc(), C4ObjectListDumpHelper::CompileFunc(), StdBitfieldAdapt< T >::CompileFunc(), StdNamingCountAdapt< int_t >::CompileFunc(), CompileNewFunc(), CompileNewFuncCtx(), C4ValueNumbers::CompileValue(), StdCompiler::DoCompilation(), C4Network2RefClient::GetReferences(), C4Playback::ReadBinary(), C4PropListStatic::RefCompileFunc(), StdPtrAdaptCompileFunc(), StdPtrAdaptDecompileNewFunc(), and unpack_class< T >::unpack().

171 { rStruct.CompileFunc(this); }
template<class T >
void StdCompiler::Value ( T &  rStruct)
inlineinherited

Definition at line 172 of file StdCompiler.h.

References CompileFunc().

172 { CompileFunc(rStruct, this); }
void CompileFunc(T &rStruct, StdCompiler *pComp)
Definition: StdCompiler.h:311

Here is the call graph for this function:

void StdCompiler::Value ( int32_t &  rInt)
inlineinherited

Definition at line 174 of file StdCompiler.h.

References StdCompiler::DWord().

174 { DWord(rInt); }
virtual void DWord(int32_t &rInt)=0

Here is the call graph for this function:

void StdCompiler::Value ( uint32_t &  rInt)
inlineinherited

Definition at line 175 of file StdCompiler.h.

References StdCompiler::DWord().

175 { DWord(rInt); }
virtual void DWord(int32_t &rInt)=0

Here is the call graph for this function:

void StdCompiler::Value ( int16_t &  rInt)
inlineinherited

Definition at line 176 of file StdCompiler.h.

References StdCompiler::Word().

176 { Word(rInt); }
virtual void Word(int16_t &rShort)=0

Here is the call graph for this function:

void StdCompiler::Value ( uint16_t &  rInt)
inlineinherited

Definition at line 177 of file StdCompiler.h.

References StdCompiler::Word().

177 { Word(rInt); }
virtual void Word(int16_t &rShort)=0

Here is the call graph for this function:

void StdCompiler::Value ( int8_t &  rInt)
inlineinherited

Definition at line 178 of file StdCompiler.h.

References StdCompiler::Byte().

178 { Byte(rInt); }
virtual void Byte(int8_t &rByte)=0

Here is the call graph for this function:

void StdCompiler::Value ( uint8_t &  rInt)
inlineinherited

Definition at line 179 of file StdCompiler.h.

References StdCompiler::Byte().

179 { Byte(rInt); }
virtual void Byte(int8_t &rByte)=0

Here is the call graph for this function:

void StdCompiler::Value ( bool &  rBool)
inlineinherited

Definition at line 180 of file StdCompiler.h.

References StdCompiler::Boolean().

180 { Boolean(rBool); }
virtual void Boolean(bool &rBool)=0

Here is the call graph for this function:

void StdCompiler::Warn ( const char *  szWarning,
  ... 
)
inherited

Definition at line 26 of file StdCompiler.cpp.

References StdStrBuf::FormatV(), StdStrBuf::getData(), and StdCompiler::getPosition().

Referenced by StdCompilerINIRead::Byte(), StdEnumAdapt< T, int_t >::CompileFunc(), StdBitfieldAdapt< T >::CompileFunc(), StdCompilerINIRead::CreateNameTree(), StdCompilerINIRead::NameEnd(), StdCompilerINIRead::Raw(), StdCompilerINIRead::ReadEscapedChar(), StdCompilerINIRead::ReadString(), and StdCompilerINIRead::Word().

27 {
28  // Got warning callback?
29  if (!pWarnCB) return;
30  // Format message
31  va_list args; va_start(args, szWarning);
32  StdStrBuf Msg; Msg.FormatV(szWarning, args);
33  // do callback
34  (*pWarnCB)(pWarnData, getPosition().getData(), Msg.getData());
35 }
const char * getData() const
Definition: StdBuf.h:450
virtual StdStrBuf getPosition() const
Definition: StdCompiler.h:161
void FormatV(const char *szFmt, va_list args)
Definition: StdBuf.cpp:189

Here is the call graph for this function:

Here is the caller graph for this function:

void StdCompilerINIWrite::Word ( int16_t &  rShort)
overridevirtual

Implements StdCompiler.

Definition at line 282 of file StdCompiler.cpp.

References StdStrBuf::AppendFormat(), Buf, and PrepareForValue().

283 {
284  PrepareForValue();
285  Buf.AppendFormat("%d", rInt);
286 }
void AppendFormat(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:197

Here is the call graph for this function:

void StdCompilerINIWrite::Word ( uint16_t &  rShort)
overridevirtual

Implements StdCompiler.

Definition at line 287 of file StdCompiler.cpp.

References StdStrBuf::AppendFormat(), Buf, and PrepareForValue().

288 {
289  PrepareForValue();
290  Buf.AppendFormat("%u", rInt);
291 }
void AppendFormat(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:197

Here is the call graph for this function:

void StdCompilerINIWrite::WriteEscaped ( const char *  szString,
const char *  pEnd 
)
protected

Definition at line 380 of file StdCompiler.cpp.

References StdStrBuf::Append(), StdStrBuf::AppendChar(), StdStrBuf::AppendFormat(), and Buf.

Referenced by Raw(), and String().

381 {
382  Buf.AppendChar('"');
383  // Try to write chunks as huge as possible of "normal" chars.
384  // Note this excludes '\0', so the standard Append() can be used.
385  const char *pStart, *pPos; pStart = pPos = szString;
386  bool fLastNumEscape = false; // catch "\1""1", which must become "\1\61"
387  for (; pPos < pEnd; pPos++)
388  if (!isprint((unsigned char)(unsigned char) *pPos) || *pPos == '\\' || *pPos == '"' || (fLastNumEscape && isdigit((unsigned char)*pPos)))
389  {
390  // Write everything up to this point
391  if (pPos - pStart) Buf.Append(pStart, pPos - pStart);
392  // Escape
393  fLastNumEscape = false;
394  switch (*pPos)
395  {
396  case '\a': Buf.Append("\\a"); break;
397  case '\b': Buf.Append("\\b"); break;
398  case '\f': Buf.Append("\\f"); break;
399  case '\n': Buf.Append("\\n"); break;
400  case '\r': Buf.Append("\\r"); break;
401  case '\t': Buf.Append("\\t"); break;
402  case '\v': Buf.Append("\\v"); break;
403  case '\"': Buf.Append("\\\""); break;
404  case '\\': Buf.Append("\\\\"); break;
405  default:
406  Buf.AppendFormat("\\%o", *reinterpret_cast<const unsigned char *>(pPos));
407  fLastNumEscape = true;
408  }
409  // Set pointer
410  pStart = pPos + 1;
411  }
412  else
413  fLastNumEscape = false;
414  // Write the rest
415  if (pEnd - pStart) Buf.Append(pStart, pEnd - pStart);
416  Buf.AppendChar('"');
417 }
void AppendFormat(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:197
void AppendChar(char cChar)
Definition: StdBuf.h:596
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:527

Here is the call graph for this function:

Here is the caller graph for this function:

void StdCompilerINIWrite::WriteIndent ( bool  fSectionName)
protected

Definition at line 419 of file StdCompiler.cpp.

References StdStrBuf::AppendChars(), Buf, and iDepth.

Referenced by PutName().

420 {
421  // Do not indent level 1 (level 0 values aren't allowed - see above)
422  int iIndent = iDepth - 1;
423  // Sections are indented more, even though they belong to this level
424  if (!fSection) iIndent--;
425  // Do indention
426  if (iIndent <= 0) return;
427  Buf.AppendChars(' ', iIndent * 2);
428 }
void AppendChars(char cChar, size_t iCnt)
Definition: StdBuf.h:590

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

StdStrBuf StdCompilerINIWrite::Buf
protected
bool StdCompilerINIWrite::fInSection
protected

Definition at line 619 of file StdCompiler.h.

Referenced by Begin(), Name(), NameEnd(), PrepareForValue(), and Separator().

bool StdCompilerINIWrite::fPutName
protected

Definition at line 619 of file StdCompiler.h.

Referenced by Begin(), Name(), NameEnd(), PrepareForValue(), and PutName().

int StdCompilerINIWrite::iDepth
protected

Definition at line 616 of file StdCompiler.h.

Referenced by Begin(), End(), Name(), NameEnd(), PrepareForValue(), and WriteIndent().

Naming* StdCompilerINIWrite::pNaming
protected

Definition at line 614 of file StdCompiler.h.

Referenced by Begin(), Name(), NameEnd(), and PutName().


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