Skip to content

Commit

Permalink
Merge pull request #25 from DaniElectra/hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbarrow authored May 20, 2023
2 parents 9c78ebc + 4276ce2 commit 41568c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stream_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ func (stream *StreamIn) ReadQBuffer() ([]byte, error) {
func (stream *StreamIn) ReadStructure(structure StructureInterface) (StructureInterface, error) {
hierarchy := structure.Hierarchy()

for _, class := range hierarchy {
_, err := stream.ReadStructure(class)
for _, parent := range hierarchy {
_, err := stream.ReadStructure(parent)

if err != nil {
return structure, errors.New("[ReadStructure] " + err.Error())
Expand Down
6 changes: 6 additions & 0 deletions stream_out.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ func (stream *StreamOut) WriteResult(result *Result) {

// WriteStructure writes a nex Structure type
func (stream *StreamOut) WriteStructure(structure StructureInterface) {
parents := structure.Hierarchy()

for _, parent := range parents {
stream.WriteStructure(parent)
}

content := structure.Bytes(NewStreamOut(stream.Server))

nexVersion := stream.Server.NEXVersion()
Expand Down

0 comments on commit 41568c0

Please sign in to comment.