MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / FrameIterator_GetFilePath

Function FrameIterator_GetFilePath

core/logic/smn_core.cpp:1173–1200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1171}
1172
1173static cell_t FrameIterator_GetFilePath(IPluginContext *pContext, const cell_t *params)
1174{
1175 Handle_t hndl = (Handle_t)params[1];
1176 HandleError err;
1177 SafeFrameIterator *iterator;
1178
1179 HandleSecurity sec;
1180 sec.pIdentity = g_pCoreIdent;
1181 sec.pOwner = pContext->GetIdentity();
1182
1183 if ((err=handlesys->ReadHandle(hndl, g_FrameIter, &sec, (void **)&iterator)) != HandleError_None)
1184 {
1185 return pContext->ThrowNativeError("Could not read Handle %x (error %d)", hndl, err);
1186 }
1187
1188 const char* filePath = iterator->FilePath();
1189 if (!filePath)
1190 {
1191 return pContext->ThrowNativeError("Iterator out of bounds. Check return value of FrameIterator.Next");
1192 }
1193
1194 char* buffer;
1195 pContext->LocalToString(params[2], &buffer);
1196 size_t size = static_cast<size_t>(params[3]);
1197
1198 ke::SafeStrcpy(buffer, size, filePath);
1199 return 0;
1200}
1201
1202static cell_t LogStackTrace(IPluginContext *pContext, const cell_t *params)
1203{

Callers

nothing calls this directly

Calls 3

FilePathMethod · 0.80
GetIdentityMethod · 0.45
ReadHandleMethod · 0.45

Tested by

no test coverage detected