MCPcopy Create free account
hub / github.com/PDAL/PDAL / relativePathName

Method relativePathName

plugins/e57/libE57Format/src/NodeImpl.cpp:97–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97ustring NodeImpl::relativePathName( const NodeImplSharedPtr &origin, ustring childPathName ) const
98{
99 checkImageFileOpen( __FILE__, __LINE__, static_cast<const char *>( __FUNCTION__ ) );
100 if ( origin == shared_from_this() )
101 {
102 return ( childPathName );
103 }
104
105 if ( isRoot() )
106 {
107 // Got to top and didn't find origin, must be error
108 throw E57_EXCEPTION2( ErrorInternal, "this->elementName=" + this->elementName() +
109 " childPathName=" + childPathName );
110 }
111
112 // Assemble relativePathName from right to left, recursively
113 NodeImplSharedPtr p( parent_ );
114
115 if ( childPathName.empty() )
116 {
117 return p->relativePathName( origin, elementName_ );
118 }
119
120 return p->relativePathName( origin, elementName_ + "/" + childPathName );
121}
122
123ustring NodeImpl::elementName() const
124{

Callers

nothing calls this directly

Calls 2

elementNameMethod · 0.95
emptyMethod · 0.45

Tested by

no test coverage detected