OpenClonk
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 ()
 
bool hasNaming () override
 
bool Name (const char *szName) override
 
void NameEnd (bool fBreak=false) override
 
bool Separator (Sep eSep) override
 
void DWord (int32_t &rInt) override
 
void DWord (uint32_t &rInt) override
 
void Word (int16_t &rShort) override
 
void Word (uint16_t &rShort) override
 
void Byte (int8_t &rByte) override
 
void Byte (uint8_t &rByte) override
 
void Boolean (bool &rBool) override
 
void Character (char &rChar) override
 
void StringN (const char *szString, size_t iMaxLength, RawCompileType eType=RCT_Escaped)
 
void String (char *szString, size_t iMaxLength, RawCompileType eType=RCT_Escaped) override
 
void String (char **pszString, RawCompileType eType=RCT_Escaped) override
 
void String (std::string &str, RawCompileType eType=RCT_Escaped) override
 
void Raw (void *pData, size_t iSize, RawCompileType eType=RCT_Escaped) override
 
void Begin () override
 
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 558 of file StdCompiler.h.


Class Documentation

◆ StdCompilerINIWrite::Naming

struct StdCompilerINIWrite::Naming

Definition at line 600 of file StdCompiler.h.

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

Member Typedef Documentation

◆ OutT

Definition at line 562 of file StdCompiler.h.

◆ WarnCBT

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

Definition at line 281 of file StdCompiler.h.

Member Enumeration Documentation

◆ RawCompileType

Enumerator
RCT_Escaped 
RCT_All 
RCT_Idtf 
RCT_IdtfAllowEmpty 
RCT_ID 

Definition at line 135 of file StdCompiler.h.

136  {
137  RCT_Escaped=0,// Any data allowed, no separator needed (default)
138  RCT_All, // Printable characters only, must be last element in naming.
139  RCT_Idtf, // Alphanumerical characters or '_', separator needed.
140  RCT_IdtfAllowEmpty, // Like RCT_Idtf, but empty strings are also allowed
141  RCT_ID // Like RCT_Idtf (only used for special compilers that treat IDs differently)
142  };
@ RCT_IdtfAllowEmpty
Definition: StdCompiler.h:140

◆ Sep

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 103 of file StdCompiler.h.

104  {
105  SEP_NONE=0, // No separator ("")
106  SEP_SEP, // Array separation (",")
107  SEP_SEP2, // Array separation 2 (";")
108  SEP_SET, // Map pair separation ("=")
109  SEP_PART, // Value part separation (".")
110  SEP_PART2, // Value part separation 2 (":")
111  SEP_PLUS, // Value separation with a '+' char ("+")
112  SEP_START, // Start some sort of list ('(')
113  SEP_END, // End some sort of list ('(')
114  SEP_START2, // Start some sort of list ('[')
115  SEP_END2, // End some sort of list (']')
116  SEP_VLINE, // Vertical line separator ('|')
117  SEP_DOLLAR // Dollar sign ('$')
118  };

Member Function Documentation

◆ Begin()

void StdCompilerINIWrite::Begin ( )
overridevirtual

Reimplemented from StdCompiler.

Definition at line 357 of file StdCompiler.cpp.

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

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

Here is the call graph for this function:

◆ BeginSecond()

virtual void StdCompiler::BeginSecond ( )
inlinevirtualinherited

Reimplemented in StdCompilerBinWrite.

Definition at line 155 of file StdCompiler.h.

155 { }

Referenced by StdCompiler::DoCompilation().

Here is the caller graph for this function:

◆ Boolean()

void StdCompilerINIWrite::Boolean ( bool &  rBool)
overridevirtual

Implements StdCompiler.

Definition at line 297 of file StdCompiler.cpp.

298 {
299  PrepareForValue();
300  Buf.Append(rBool ? "true" : "false");
301 }
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:519

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

Here is the call graph for this function:

◆ Byte() [1/2]

void StdCompilerINIWrite::Byte ( int8_t &  rByte)
overridevirtual

Implements StdCompiler.

Definition at line 287 of file StdCompiler.cpp.

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

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

Here is the call graph for this function:

◆ Byte() [2/2]

void StdCompilerINIWrite::Byte ( uint8_t &  rByte)
overridevirtual

Implements StdCompiler.

Definition at line 292 of file StdCompiler.cpp.

293 {
294  PrepareForValue();
295  Buf.AppendFormat("%u", rInt);
296 }

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

Here is the call graph for this function:

◆ Character()

void StdCompilerINIWrite::Character ( char &  rChar)
overridevirtual

Implements StdCompiler.

Definition at line 302 of file StdCompiler.cpp.

303 {
304  PrepareForValue();
305  Buf.AppendFormat("%c", rChar);
306 }

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

Here is the call graph for this function:

◆ Compile()

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

Definition at line 173 of file StdCompiler.h.

174  {
175  assert(isDeserializer());
176  DoCompilation(rStruct);
177  }
void DoCompilation(T &rStruct)
Definition: StdCompiler.h:188
virtual bool isDeserializer()
Definition: StdCompiler.h:53

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Decompile()

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

Definition at line 178 of file StdCompiler.h.

179  {
180  assert(!isDeserializer());
181  DoCompilation(const_cast<T &>(rStruct));
182  }

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Default()

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

Reimplemented in C4ValueCompiler.

Definition at line 88 of file StdCompiler.h.

88 { return true; }

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

Here is the caller graph for this function:

◆ DoCompilation()

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

Definition at line 188 of file StdCompiler.h.

189  {
190  // Start compilation, do first pass
191  Begin();
192  Value(rStruct);
193  // Second pass needed?
194  if (isDoublePass())
195  {
196  BeginSecond();
197  Value(rStruct);
198  }
199  // Finish
200  End();
201  }
virtual void BeginSecond()
Definition: StdCompiler.h:155
void Value(const T &rStruct)
Definition: StdCompiler.h:161
virtual void End()
Definition: StdCompiler.h:156
virtual bool isDoublePass()
Definition: StdCompiler.h:50
virtual void Begin()
Definition: StdCompiler.h:154

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DWord() [1/2]

void StdCompilerINIWrite::DWord ( int32_t &  rInt)
overridevirtual

Implements StdCompiler.

Definition at line 267 of file StdCompiler.cpp.

268 {
269  PrepareForValue();
270  Buf.AppendFormat("%d", rInt);
271 }

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

Here is the call graph for this function:

◆ DWord() [2/2]

void StdCompilerINIWrite::DWord ( uint32_t &  rInt)
overridevirtual

Implements StdCompiler.

Definition at line 272 of file StdCompiler.cpp.

273 {
274  PrepareForValue();
275  Buf.AppendFormat("%u", rInt);
276 }

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

Here is the call graph for this function:

◆ End()

void StdCompilerINIWrite::End ( )
overridevirtual

Reimplemented from StdCompiler.

Definition at line 366 of file StdCompiler.cpp.

367 {
368  // Ensure all namings were closed properly
369  assert(!iDepth);
370 }

References iDepth.

◆ excCorrupt()

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

Definition at line 249 of file StdCompiler.h.

250  {
251  // Throw the appropriate exception
252  va_list args; va_start(args, szMessage);
253  throw new CorruptException(getPosition(), FormatStringV(szMessage, args));
254  }
StdStrBuf FormatStringV(const char *szFmt, va_list args)
Definition: StdBuf.cpp:276
virtual StdStrBuf getPosition() const
Definition: StdCompiler.h:151

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ excEOF()

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

Definition at line 243 of file StdCompiler.h.

244  {
245  // Throw the appropriate exception
246  va_list args; va_start(args, szMessage);
247  throw new EOFException(getPosition(), FormatStringV(szMessage, args));
248  }

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ excNotFound()

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

Definition at line 233 of file StdCompiler.h.

234  {
235 #ifdef STDCOMPILER_EXCEPTION_WORKAROUND
236  // Exception workaround: Just set a flag in failesafe mode.
237  if (fFailSafe) { fFail = true; return; }
238 #endif
239  // Throw the appropriate exception
240  va_list args; va_start(args, szMessage);
241  throw new NotFoundException(getPosition(), FormatStringV(szMessage, args));
242  }

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FollowName()

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

Reimplemented in StdCompilerINIRead.

Definition at line 84 of file StdCompiler.h.

84 { NameEnd(); return Name(szName); }
virtual void NameEnd(bool fBreak=false)
Definition: StdCompiler.h:78
virtual bool Name(const char *szName)
Definition: StdCompiler.h:77

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

Referenced by C4Object::CompileFunc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNameByIndex()

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

Reimplemented in StdCompilerINIRead.

Definition at line 79 of file StdCompiler.h.

79 { return nullptr; }

Referenced by C4ScenarioParameters::CompileFunc().

Here is the caller graph for this function:

◆ getOutput()

OutT StdCompilerINIWrite::getOutput ( )
inline

Definition at line 563 of file StdCompiler.h.

563 { return Buf; }

References Buf.

Referenced by C4Config::Save().

Here is the caller graph for this function:

◆ getPosition()

virtual StdStrBuf StdCompiler::getPosition ( ) const
inlinevirtualinherited

Reimplemented in StdCompilerINIRead, and StdCompilerBinRead.

Definition at line 151 of file StdCompiler.h.

151 { return StdStrBuf(); }

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

Here is the caller graph for this function:

◆ hasNaming()

bool StdCompilerINIWrite::hasNaming ( )
inlineoverridevirtual

Reimplemented from StdCompiler.

Definition at line 566 of file StdCompiler.h.

566 { return true; }

◆ isDeserializer()

virtual bool StdCompiler::isDeserializer ( )
inlinevirtualinherited

Reimplemented in StdCompilerINIRead, StdCompilerBinRead, StdCompilerNull, and C4ValueCompiler.

Definition at line 53 of file StdCompiler.h.

53 { return false; }

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

◆ isDoublePass()

virtual bool StdCompiler::isDoublePass ( )
inlinevirtualinherited

Reimplemented in StdCompilerBinWrite.

Definition at line 50 of file StdCompiler.h.

50 { return false; }

Referenced by StdCompiler::DoCompilation().

Here is the caller graph for this function:

◆ isRegistry()

virtual bool StdCompiler::isRegistry ( )
inlinevirtualinherited

Definition at line 65 of file StdCompiler.h.

65 { return false; }

Referenced by C4PlayerControlAssignmentSets::CompileFunc().

Here is the caller graph for this function:

◆ isSerializer()

bool StdCompiler::isSerializer ( )
inlineinherited

Definition at line 54 of file StdCompiler.h.

54 { return !isDeserializer(); }

References StdCompiler::isDeserializer().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsStringEnd()

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

Definition at line 53 of file StdCompiler.cpp.

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

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

Referenced by StdCompilerINIRead::TestStringEnd().

Here is the caller graph for this function:

◆ isVerbose()

virtual bool StdCompiler::isVerbose ( )
inlinevirtualinherited

Reimplemented in C4ValueCompiler.

Definition at line 62 of file StdCompiler.h.

62 { return hasNaming(); }
virtual bool hasNaming()
Definition: StdCompiler.h:58

References StdCompiler::hasNaming().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Name()

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

Reimplemented from StdCompiler.

Definition at line 218 of file StdCompiler.cpp.

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

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

Here is the call graph for this function:

◆ NameCount()

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

Reimplemented in StdCompilerINIRead, and StdCompilerNull.

Definition at line 91 of file StdCompiler.h.

91 { assert(false); return 0; }

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

Here is the caller graph for this function:

◆ NameEnd()

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

Reimplemented from StdCompiler.

Definition at line 233 of file StdCompiler.cpp.

234 {
235  // Append newline
236  if (!fPutName && !fInSection)
237  Buf.Append("\n");
238  fPutName = false;
239  // Note this makes it impossible to distinguish an empty name section from
240  // a non-existing name section.
241 
242  // Pop
243  assert(iDepth);
244  Naming *poNaming = pNaming;
245  pNaming = poNaming->Parent;
246  delete poNaming;
247  iDepth--;
248  // We're inside a section now
249  fInSection = true;
250 }

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

Here is the call graph for this function:

◆ NoSeparator()

virtual void StdCompiler::NoSeparator ( )
inlinevirtualinherited

Reimplemented in StdCompilerINIRead.

Definition at line 120 of file StdCompiler.h.

120 { }

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

Here is the caller graph for this function:

◆ PrepareForValue()

void StdCompilerINIWrite::PrepareForValue ( )
protected

Definition at line 372 of file StdCompiler.cpp.

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

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PutName()

void StdCompilerINIWrite::PutName ( bool  fSection)
protected

Definition at line 432 of file StdCompiler.cpp.

433 {
434  if (fSection && Buf.getLength())
435  Buf.Append("\n");
436  WriteIndent(fSection);
437  // Put name
438  if (fSection)
439  Buf.AppendFormat("[%s]\n", pNaming->Name.getData());
440  else
441  Buf.AppendFormat("%s=", pNaming->Name.getData());
442  // Set flag
443  fPutName = false;
444 }
void WriteIndent(bool fSectionName)
const char * getData() const
Definition: StdBuf.h:442
size_t getLength() const
Definition: StdBuf.h:445

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Raw()

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

Implements StdCompiler.

Definition at line 337 of file StdCompiler.cpp.

338 {
339  switch (eType)
340  {
341  case RCT_Escaped:
342  WriteEscaped(reinterpret_cast<char *>(pData), reinterpret_cast<char *>(pData) + iSize);
343  break;
344  case RCT_All:
345  case RCT_Idtf:
346  case RCT_IdtfAllowEmpty:
347  case RCT_ID:
348  Buf.Append(reinterpret_cast<char *>(pData), iSize);
349  }
350 }
int iSize
Definition: TstC4NetIO.cpp:32
void WriteEscaped(const char *szString, const char *pEnd)

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

Here is the call graph for this function:

◆ Separator()

bool StdCompilerINIWrite::Separator ( Sep  eSep)
overridevirtual

Reimplemented from StdCompiler.

Definition at line 252 of file StdCompiler.cpp.

253 {
254  if (fInSection)
255  {
256  // Re-put section name
257  PutName(true);
258  }
259  else
260  {
261  PrepareForValue();
263  }
264  return true;
265 }
static char SeparatorToChar(Sep eSep)
Definition: StdCompiler.cpp:32
void AppendChar(char cChar)
Definition: StdBuf.h:588

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

Here is the call graph for this function:

◆ SeparatorToChar()

char StdCompiler::SeparatorToChar ( Sep  eSep)
staticprotectedinherited

Definition at line 32 of file StdCompiler.cpp.

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

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().

Here is the caller graph for this function:

◆ setRuntimeWritesAllowed()

virtual void StdCompiler::setRuntimeWritesAllowed ( int32_t  iChange)
inlinevirtualinherited

Definition at line 68 of file StdCompiler.h.

68 { }

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

Here is the caller graph for this function:

◆ setWarnCallback()

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

Definition at line 282 of file StdCompiler.h.

282 { pWarnCB = pnWarnCB; pWarnData = pData; }

◆ String() [1/3]

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

Implements StdCompiler.

Definition at line 329 of file StdCompiler.cpp.

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

References String().

Here is the call graph for this function:

◆ String() [2/3]

void StdCompilerINIWrite::String ( char *  szString,
size_t  iMaxLength,
RawCompileType  eType = RCT_Escaped 
)
overridevirtual

Implements StdCompiler.

Definition at line 308 of file StdCompiler.cpp.

309 {
310  StringN(szString, strnlen(szString, iMaxLength), eType);
311 }
void StringN(const char *szString, size_t iMaxLength, RawCompileType eType=RCT_Escaped)

References StringN().

Referenced by String().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ String() [3/3]

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

Implements StdCompiler.

Definition at line 352 of file StdCompiler.cpp.

353 {
354  StringN(str.c_str(), str.size(), type);
355 }

References StringN().

Here is the call graph for this function:

◆ StringN()

void StdCompilerINIWrite::StringN ( const char *  szString,
size_t  iMaxLength,
RawCompileType  eType = RCT_Escaped 
)

Definition at line 313 of file StdCompiler.cpp.

314 {
315  PrepareForValue();
316  switch (eType)
317  {
318  case RCT_Escaped:
319  WriteEscaped(szString, szString + iLength);
320  break;
321  case RCT_All:
322  case RCT_Idtf:
323  case RCT_IdtfAllowEmpty:
324  case RCT_ID:
325  Buf.Append(szString);
326  }
327 }

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Value() [1/9]

void StdCompiler::Value ( bool &  rBool)
inlineinherited

Definition at line 170 of file StdCompiler.h.

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

References StdCompiler::Boolean().

Here is the call graph for this function:

◆ Value() [2/9]

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

Definition at line 161 of file StdCompiler.h.

161 { rStruct.CompileFunc(this); }

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

◆ Value() [3/9]

void StdCompiler::Value ( int16_t &  rInt)
inlineinherited

Definition at line 166 of file StdCompiler.h.

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

References StdCompiler::Word().

Here is the call graph for this function:

◆ Value() [4/9]

void StdCompiler::Value ( int32_t &  rInt)
inlineinherited

Definition at line 164 of file StdCompiler.h.

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

References StdCompiler::DWord().

Here is the call graph for this function:

◆ Value() [5/9]

void StdCompiler::Value ( int8_t &  rInt)
inlineinherited

Definition at line 168 of file StdCompiler.h.

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

References StdCompiler::Byte().

Here is the call graph for this function:

◆ Value() [6/9]

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

Definition at line 162 of file StdCompiler.h.

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

References CompileFunc().

Here is the call graph for this function:

◆ Value() [7/9]

void StdCompiler::Value ( uint16_t &  rInt)
inlineinherited

Definition at line 167 of file StdCompiler.h.

167 { Word(rInt); }

References StdCompiler::Word().

Here is the call graph for this function:

◆ Value() [8/9]

void StdCompiler::Value ( uint32_t &  rInt)
inlineinherited

Definition at line 165 of file StdCompiler.h.

165 { DWord(rInt); }

References StdCompiler::DWord().

Here is the call graph for this function:

◆ Value() [9/9]

void StdCompiler::Value ( uint8_t &  rInt)
inlineinherited

Definition at line 169 of file StdCompiler.h.

169 { Byte(rInt); }

References StdCompiler::Byte().

Here is the call graph for this function:

◆ Warn()

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

Definition at line 21 of file StdCompiler.cpp.

22 {
23  // Got warning callback?
24  if (!pWarnCB) return;
25  // Format message
26  va_list args; va_start(args, szWarning);
27  StdStrBuf Msg; Msg.FormatV(szWarning, args);
28  // do callback
29  (*pWarnCB)(pWarnData, getPosition().getData(), Msg.getData());
30 }
void FormatV(const char *szFmt, va_list args)
Definition: StdBuf.cpp:182

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Word() [1/2]

void StdCompilerINIWrite::Word ( int16_t &  rShort)
overridevirtual

Implements StdCompiler.

Definition at line 277 of file StdCompiler.cpp.

278 {
279  PrepareForValue();
280  Buf.AppendFormat("%d", rInt);
281 }

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

Here is the call graph for this function:

◆ Word() [2/2]

void StdCompilerINIWrite::Word ( uint16_t &  rShort)
overridevirtual

Implements StdCompiler.

Definition at line 282 of file StdCompiler.cpp.

283 {
284  PrepareForValue();
285  Buf.AppendFormat("%u", rInt);
286 }

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

Here is the call graph for this function:

◆ WriteEscaped()

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

Definition at line 382 of file StdCompiler.cpp.

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

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

Referenced by Raw(), and StringN().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteIndent()

void StdCompilerINIWrite::WriteIndent ( bool  fSectionName)
protected

Definition at line 421 of file StdCompiler.cpp.

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

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

Referenced by PutName().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ Buf

StdStrBuf StdCompilerINIWrite::Buf
protected

◆ fInSection

bool StdCompilerINIWrite::fInSection
protected

Definition at line 612 of file StdCompiler.h.

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

◆ fPutName

bool StdCompilerINIWrite::fPutName
protected

Definition at line 610 of file StdCompiler.h.

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

◆ iDepth

int StdCompilerINIWrite::iDepth
protected

Definition at line 607 of file StdCompiler.h.

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

◆ pNaming

Naming* StdCompilerINIWrite::pNaming
protected

Definition at line 605 of file StdCompiler.h.

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


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