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

Method GetNamespaceURI

xmpsdk/src/XMPMeta.cpp:1090–1113  ·  view source on GitHub ↗

class-static */

Source from the content-addressed store, hash-verified

1088// ---------------
1089
1090/* class-static */ bool
1091XMPMeta::GetNamespaceURI ( XMP_StringPtr namespacePrefix,
1092 XMP_StringPtr * namespaceURI,
1093 XMP_StringLen * uriSize )
1094{
1095 bool found = false;
1096
1097 XMP_Assert ( *namespacePrefix != 0 ); // ! Enforced by wrapper.
1098 XMP_Assert ( (namespacePrefix != 0) && (namespaceURI != 0) ); // ! Enforced by wrapper.
1099
1100 XMP_VarString nsPrefix ( namespacePrefix );
1101 if ( nsPrefix[nsPrefix.size()-1] != ':' ) nsPrefix += ':';
1102
1103 XMP_StringMapPos prefixPos = sNamespacePrefixToURIMap->find ( nsPrefix );
1104
1105 if ( prefixPos != sNamespacePrefixToURIMap->end() ) {
1106 *namespaceURI = prefixPos->second.c_str();
1107 *uriSize = prefixPos->second.size();
1108 found = true;
1109 }
1110
1111 return found;
1112
1113} // GetNamespaceURI
1114
1115
1116// -------------------------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 3

c_strMethod · 0.80
sizeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected