MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / ComposeQualifierPath

Method ComposeQualifierPath

xmpsdk/src/XMPUtils.cpp:783–813  ·  view source on GitHub ↗

class static */

Source from the content-addressed store, hash-verified

781// Return "propName/?ns:qualName".
782
783/* class static */ void
784XMPUtils::ComposeQualifierPath ( XMP_StringPtr schemaNS,
785 XMP_StringPtr propName,
786 XMP_StringPtr qualNS,
787 XMP_StringPtr qualName,
788 XMP_StringPtr * fullPath,
789 XMP_StringLen * pathSize )
790{
791 XMP_Assert ( (schemaNS != 0) && (qualNS != 0) ); // Enforced by wrapper.
792 XMP_Assert ( (*propName != 0) && (*qualName != 0) ); // Enforced by wrapper.
793 XMP_Assert ( (fullPath != 0) && (pathSize != 0) ); // Enforced by wrapper.
794
795 XMP_ExpandedXPath expPath; // Just for side effects to check namespace and basic path.
796 ExpandXPath ( schemaNS, propName, &expPath );
797
798 XMP_ExpandedXPath qualPath;
799 ExpandXPath ( qualNS, qualName, &qualPath );
800 if ( qualPath.size() != 2 ) XMP_Throw ( "The qualifier name must be simple", kXMPErr_BadXPath );
801
802 XMP_StringLen reserveLen = strlen(propName) + qualPath[kRootPropStep].step.size() + 2;
803
804 sComposedPath->erase();
805 sComposedPath->reserve ( reserveLen );
806 *sComposedPath = propName;
807 *sComposedPath += "/?";
808 *sComposedPath += qualPath[kRootPropStep].step;
809
810 *fullPath = sComposedPath->c_str();
811 *pathSize = sComposedPath->size();
812
813} // ComposeQualifierPath
814
815
816// -------------------------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 5

ExpandXPathFunction · 0.85
reserveMethod · 0.80
c_strMethod · 0.80
sizeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected