Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E57 debug fixups #82

Merged
merged 2 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/CompressedVectorReaderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ namespace e57
}
}

#ifdef E57_DEBUG
void CompressedVectorReaderImpl::dump( int indent, std::ostream &os )
{
os << space( indent ) << "isOpen:" << isOpen_ << std::endl;
Expand All @@ -600,5 +601,6 @@ namespace e57
os << space( indent ) << "maxRecordCount: " << maxRecordCount_ << std::endl;
os << space( indent ) << "sectionEndLogicalOffset: " << sectionEndLogicalOffset_ << std::endl;
}
#endif

}
2 changes: 2 additions & 0 deletions src/CompressedVectorWriterImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ namespace e57
}
}

#ifdef E57_DEBUG
void CompressedVectorWriterImpl::dump( int indent, std::ostream &os )
{
os << space( indent ) << "isOpen:" << isOpen_ << std::endl;
Expand Down Expand Up @@ -655,4 +656,5 @@ namespace e57
os << space( indent ) << "dataPacketsCount: " << dataPacketsCount_ << std::endl;
os << space( indent ) << "indexPacketsCount: " << indexPacketsCount_ << std::endl;
}
#endif
}
2 changes: 2 additions & 0 deletions src/DecodeChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ namespace e57
return ( currentBytestreamBufferIndex == currentBytestreamBufferLength );
}

#ifdef E57_DEBUG
void DecodeChannel::dump( int indent, std::ostream &os )
{
os << space( indent ) << "dbuf" << std::endl;
Expand All @@ -83,4 +84,5 @@ namespace e57
os << space( indent ) << "isInputBlocked(): " << isInputBlocked() << std::endl;
os << space( indent ) << "isOutputBlocked(): " << isOutputBlocked() << std::endl;
}
#endif
}
2 changes: 2 additions & 0 deletions src/ImageFileImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ namespace e57
}
}

#ifdef E57_DEBUG
void ImageFileImpl::dump( int indent, std::ostream &os ) const
{
/// no checkImageFileOpen(__FILE__, __LINE__, __FUNCTION__)
Expand All @@ -884,6 +885,7 @@ namespace e57
os << space( indent ) << "root: " << std::endl;
root_->dump( indent + 2, os );
}
#endif

unsigned ImageFileImpl::bitsNeeded( int64_t minimum, int64_t maximum )
{
Expand Down
6 changes: 5 additions & 1 deletion src/NodeImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ NodeImplSharedPtr NodeImpl::get( const ustring &pathName )
/// function. Only absolute pathNames make any sense here, because the
/// terminal types can't have children, so relative pathNames are illegal.

#ifdef E57_DEBUG
_verifyPathNameAbsolute( pathName );
#endif

NodeImplSharedPtr root = _verifyAndGetRoot();

Expand All @@ -256,7 +258,9 @@ void NodeImpl::set( const ustring &pathName, NodeImplSharedPtr ni, bool autoPath
/// function. Only absolute pathNames make any sense here, because the
/// terminal types can't have children, so relative pathNames are illegal.

#ifdef E57_DEBUG
_verifyPathNameAbsolute( pathName );
#endif

NodeImplSharedPtr root = _verifyAndGetRoot();

Expand Down Expand Up @@ -405,6 +409,7 @@ bool NodeImpl::_verifyPathNameAbsolute( const ustring &inPathName )

return isRelative;
}
#endif

NodeImplSharedPtr NodeImpl::_verifyAndGetRoot()
{
Expand All @@ -424,4 +429,3 @@ NodeImplSharedPtr NodeImpl::_verifyAndGetRoot()

return root;
}
#endif
2 changes: 2 additions & 0 deletions src/NodeImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ namespace e57
#endif

private:
#ifdef E57_DEBUG
bool _verifyPathNameAbsolute( const ustring &inPathName );
#endif

NodeImplSharedPtr _verifyAndGetRoot();

Expand Down