MCPcopy Create free account
hub / github.com/Sigil-Ebook/Sigil / GetUUIDIdentifierValue

Method GetUUIDIdentifierValue

src/ResourceObjects/OPFResource.cpp:374–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372
373
374QString OPFResource::GetUUIDIdentifierValue()
375{
376 EnsureUUIDIdentifierPresent();
377 QReadLocker locker(&GetLock());
378 QString source = CleanSource::ProcessXML(GetText(),"application/oebps-package+xml");
379 OPFParser p;
380 p.parse(source);
381 for (int i=0; i < p.m_metadata.count(); ++i) {
382 MetaEntry me = p.m_metadata.at(i);
383 if(me.m_name.startsWith("dc:identifier")) {
384 QString value = QString(me.m_content).remove("urn:uuid:");
385 if (!QUuid(value).isNull()) {
386 return value;
387 }
388 }
389 }
390 // EnsureUUIDIdentifierPresent should ensure we
391 // never reach here.
392 Q_ASSERT(false);
393 return QString();
394}
395
396
397void OPFResource::EnsureUUIDIdentifierPresent()

Callers 6

ObfuscateFontsMethod · 0.80
RepoCommitMethod · 0.80
RepoCheckoutMethod · 0.80
RepoDiffMethod · 0.80
RepoShowLogMethod · 0.80

Calls 4

isNullMethod · 0.80
QStringClass · 0.70
parseMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected