OpenClonk
C4AulScriptContext Struct Reference

#include <C4AulExec.h>

Collaboration diagram for C4AulScriptContext:
[legend]

Public Member Functions

void dump (StdStrBuf Dump=StdStrBuf(""))
 
StdStrBuf ReturnDump (StdStrBuf Dump=StdStrBuf(""))
 

Public Attributes

C4PropListObj
 
C4ValueReturn
 
C4ValuePars
 
C4AulScriptFuncFunc
 
C4AulBCCCPos
 
C4TimeMilliseconds tTime
 

Detailed Description

Definition at line 41 of file C4AulExec.h.

Member Function Documentation

◆ dump()

void C4AulScriptContext::dump ( StdStrBuf  Dump = StdStrBuf(""))

Definition at line 88 of file C4AulExec.cpp.

References DebugLog().

89 {
90  // Log it
91  DebugLog(ReturnDump(Dump).getData());
92 }
StdStrBuf ReturnDump(StdStrBuf Dump=StdStrBuf(""))
Definition: C4AulExec.cpp:38
bool DebugLog(const char *strMessage)
Definition: C4Log.cpp:280
Here is the call graph for this function:

◆ ReturnDump()

StdStrBuf C4AulScriptContext::ReturnDump ( StdStrBuf  Dump = StdStrBuf(""))

Definition at line 38 of file C4AulExec.cpp.

39 {
40  if (!Func)
41  return StdStrBuf("");
42  // Context
43  if (Obj && Obj->Status)
44  {
45  C4Value ObjVal(Obj);
46  Dump.Append(ObjVal.GetDataString(0));
47  Dump.Append("->");
48  }
49  bool fDirectExec = !Func->GetName();
50  if (!fDirectExec)
51  {
52  // Function name
53  Dump.Append(Func->GetName());
54  // Parameters
55  Dump.AppendChar('(');
56  int iNullPars = 0;
57  for (int i = 0; i < Func->GetParCount(); i++)
58  {
59  if (!Pars[i])
60  iNullPars++;
61  else
62  {
63  if (i > iNullPars)
64  Dump.AppendChar(',');
65  // Insert missing null parameters
66  while (iNullPars > 0)
67  {
68  Dump.Append("0,");
69  iNullPars--;
70  }
71  // Insert parameter
72  Dump.Append(Pars[i].GetDataString());
73  }
74  }
75  Dump.AppendChar(')');
76  }
77  else
78  Dump.Append(Func->Parent->GetDataString());
79  // Script
80  if (!fDirectExec && Func->pOrgScript)
81  Dump.AppendFormat(" (%s:%d)",
84  // Return it
85  return Dump;
86 }
C4Value * Pars
Definition: C4AulExec.h:45
const char * GetScript() const
Definition: C4ScriptHost.h:52
int SGetLine(const char *szText, const char *cpPosition)
Definition: Standard.cpp:473
C4ScriptHost * pOrgScript
const char * GetName() const
Definition: C4AulFunc.h:56
C4AulScriptFunc * Func
Definition: C4AulExec.h:46
void AppendFormat(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:190
int GetParCount() const override
void AppendChar(char cChar)
Definition: StdBuf.h:588
int GetLineOfCode(C4AulBCC *bcc)
C4AulBCC * CPos
Definition: C4AulExec.h:47
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:519
int32_t Status
Definition: C4PropList.h:168
StdStrBuf GetDataString() const
Definition: C4PropList.cpp:253
const char * getData() const
Definition: StdBuf.h:442
C4PropList * Obj
Definition: C4AulExec.h:43
C4PropListStatic * Parent
Definition: C4AulFunc.h:55
const char * Script
StdCopyStrBuf ScriptName
Definition: C4ScriptHost.h:57

Member Data Documentation

◆ CPos

C4AulBCC* C4AulScriptContext::CPos

Definition at line 47 of file C4AulExec.h.

Referenced by C4AulExec::ClearPointers(), and C4AulDebug::ControlScriptEvaluated().

◆ Func

◆ Obj

C4PropList* C4AulScriptContext::Obj

Definition at line 43 of file C4AulExec.h.

Referenced by C4AulExec::ClearPointers(), and C4AulDebug::OnLog().

◆ Pars

C4Value* C4AulScriptContext::Pars

Definition at line 45 of file C4AulExec.h.

Referenced by C4AulExec::ClearPointers(), C4AulExec::GetContext(), and C4AulDebug::OnLog().

◆ Return

C4Value* C4AulScriptContext::Return

Definition at line 44 of file C4AulExec.h.

Referenced by C4AulExec::ClearPointers().

◆ tTime

C4TimeMilliseconds C4AulScriptContext::tTime

Definition at line 48 of file C4AulExec.h.

Referenced by C4AulExec::ClearPointers().


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