MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / parse

Method parse

Engine/source/persistence/taml/taml.cpp:415–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413 //-----------------------------------------------------------------------------
414
415 bool Taml::parse(const char* pFilename, TamlVisitor& visitor)
416 {
417 // Debug Profiling.
418 PROFILE_SCOPE(Taml_Parse);
419
420 // Sanity!
421 AssertFatal(pFilename != NULL, "Taml::parse() - Cannot parse a NULL filename.");
422
423 // Fetch format mode.
424 const TamlFormatMode formatMode = getFileAutoFormatMode(pFilename);
425
426 // Handle format mode appropriately.
427 switch (formatMode)
428 {
429 case XmlFormat:
430 {
431 // Parse with the visitor.
432 TamlXmlParser parser;
433
434 // Are property changes needed but not supported?
435 if (visitor.wantsPropertyChanges() && !parser.canChangeProperty())
436 {
437 // Yes, so warn.
438 Con::warnf("Taml::parse() - Cannot parse '%s' file-type for filename '%s' as a specified visitor requires property changes which are not supported by the parser.", getFormatModeDescription(formatMode), pFilename);
439 return false;
440 }
441
442 return parser.accept(pFilename, visitor);
443 }
444
445 case JSONFormat:
446 {
447 // Parse with the visitor.
448 /*TamlJSONParser parser;
449
450 // Are property changes needed but not supported?
451 if ( visitor.wantsPropertyChanges() && !parser.canChangeProperty() )
452 {
453 // Yes, so warn.
454 Con::warnf( "Taml::parse() - Cannot parse '%s' file-type for filename '%s' as a specified visitor requires property changes which are not supported by the parser.", getFormatModeDescription(formatMode), pFilename );
455 return false;
456 }
457
458 return parser.accept( pFilename, visitor ); */
459 return false;
460 }
461
462 case BinaryFormat:
463 default:
464 break;
465 }
466
467 // Warn.
468 Con::warnf("Taml::parse() - Cannot parse '%s' file-type for filename '%s' as a required parser is not available.", getFormatModeDescription(formatMode), pFilename);
469 return false;
470 }
471
472 //-----------------------------------------------------------------------------

Callers 8

copyModuleMethod · 0.45
renameModuleMethod · 0.45
renameDeclaredAssetMethod · 0.45
refreshAssetMethod · 0.45
scanDeclaredAssetsMethod · 0.45
scanReferencedAssetsMethod · 0.45
renameAssetReferencesMethod · 0.45
removeAssetReferencesMethod · 0.45

Calls 4

warnfFunction · 0.50
wantsPropertyChangesMethod · 0.45
canChangePropertyMethod · 0.45
acceptMethod · 0.45

Tested by

no test coverage detected