| 95 | } |
| 96 | |
| 97 | ustring 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 | |
| 123 | ustring NodeImpl::elementName() const |
| 124 | { |
nothing calls this directly
no test coverage detected