OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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

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

Definition at line 92 of file C4AulExec.cpp.

References DebugLog(), and ReturnDump().

93 {
94  // Log it
95  DebugLog(ReturnDump(Dump).getData());
96 }
StdStrBuf ReturnDump(StdStrBuf Dump=StdStrBuf(""))
Definition: C4AulExec.cpp:42
bool DebugLog(const char *strMessage)
Definition: C4Log.cpp:273

Here is the call graph for this function:

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

Definition at line 42 of file C4AulExec.cpp.

References StdStrBuf::Append(), StdStrBuf::AppendChar(), StdStrBuf::AppendFormat(), CPos, Func, StdStrBuf::getData(), C4Value::GetDataString(), C4PropListStatic::GetDataString(), C4AulScriptFunc::GetLineOfCode(), C4AulFunc::GetName(), C4AulScriptFunc::GetParCount(), C4ScriptHost::GetScript(), Obj, C4AulFunc::Parent, Pars, C4AulScriptFunc::pOrgScript, C4AulScriptFunc::Script, C4ScriptHost::ScriptName, SGetLine(), and C4PropList::Status.

Referenced by dump().

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

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

C4AulBCC* C4AulScriptContext::CPos

Definition at line 47 of file C4AulExec.h.

Referenced by ReturnDump().

C4AulScriptFunc* C4AulScriptContext::Func

Definition at line 46 of file C4AulExec.h.

Referenced by C4AulExec::FnTranslate(), and ReturnDump().

C4PropList* C4AulScriptContext::Obj

Definition at line 43 of file C4AulExec.h.

Referenced by ReturnDump().

C4Value* C4AulScriptContext::Pars

Definition at line 45 of file C4AulExec.h.

Referenced by ReturnDump().

C4Value* C4AulScriptContext::Return

Definition at line 44 of file C4AulExec.h.

C4TimeMilliseconds C4AulScriptContext::tTime

Definition at line 48 of file C4AulExec.h.


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