MCPcopy Create free account
hub / github.com/Tencent/libpag / CheckLayerMarkerCharacter

Function CheckLayerMarkerCharacter

exporter/src/export/ExportVerify.cpp:433–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431}
432
433static void CheckLayerMarkerCharacter(std::shared_ptr<PAGExportSession> session,
434 pag::Layer* layer) {
435 for (auto marker : layer->markers) {
436 auto& comment = marker->comment;
437
438 /* Normal Json */
439 QJsonParseError parseError;
440 QJsonDocument::fromJson(comment.c_str(), &parseError);
441 if (parseError.error == QJsonParseError::NoError) {
442 continue;
443 }
444
445 /* Normal Comment */
446 auto posStart = comment.find_first_of('{');
447 auto posEnd = comment.find_first_of('}');
448 if (posStart == std::string::npos || posEnd == std::string::npos) {
449 continue;
450 }
451
452 if (HasChineseCharacter(comment)) {
453 session->pushWarning(AlertInfoType::MarkerJsonHasChinese, comment);
454 } else {
455 session->pushWarning(AlertInfoType::MarkerJsonGrammar, comment);
456 }
457 }
458}
459
460static void CheckLayerDisplacementMap(std::shared_ptr<PAGExportSession> session,
461 pag::Layer* layer) {

Callers 1

CheckLayerPropertyFunction · 0.85

Calls 2

HasChineseCharacterFunction · 0.85
pushWarningMethod · 0.45

Tested by

no test coverage detected