MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / setDefaultFile

Method setDefaultFile

Engine/source/platform/nativeDialogs/fileDialog.cpp:452–472  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Default File Property - String Validated on Write -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

450// Default File Property - String Validated on Write
451//-----------------------------------------------------------------------------
452bool FileDialog::setDefaultFile(void *object, const char *index, const char *data)
453{
454 if (!data || !dStrncmp(data, "", 1))
455 return true;
456
457 // Copy and Backslash the path (Windows dialogs are VERY picky about this format)
458 static char szPathValidate[512];
459 Platform::makeFullPathName(data, szPathValidate, sizeof(szPathValidate));
460 //backslash( szPathValidate );
461
462 // Remove any trailing \'s
463 S8 validateLen = dStrlen(szPathValidate);
464 if (szPathValidate[validateLen - 1] == '\\')
465 szPathValidate[validateLen - 1] = '\0';
466
467 // Finally, assign in proper format.
468 FileDialog *pDlg = static_cast<FileDialog*>(object);
469 pDlg->mData.mDefaultFile = StringTable->insert(szPathValidate);
470
471 return false;
472};
473
474//-----------------------------------------------------------------------------
475// ChangePath Property - Change working path on successful file selection

Callers

nothing calls this directly

Calls 3

dStrncmpFunction · 0.85
dStrlenFunction · 0.50
insertMethod · 0.45

Tested by

no test coverage detected