H-uru / Plasma

Cyan Worlds's Plasma game engine
http://h-uru.github.io/Plasma/
GNU General Public License v3.0
205 stars 80 forks source link

Clean up and consistently implement the `hsStream` API #1439

Closed dgelessus closed 1 year ago

dgelessus commented 1 year ago

Some hsStream methods weren't implemented in all subclasses even though they should have been. This fixes those cases - either implementing the missing methods, or removing them from the base hsStream if they actually only make sense for some subclasses.

A few things in the stream classes were implemented twice under different names for no apparent reason, so I removed those duplicates.

Notably, this merges hsRAMStream and hsVectorStream. Both provided a memory-based read/write stream, but with two different implementations for the dynamic memory buffer. I kept just the std::vector version from hsVectorStream, because I don't see any advantage to the custom hsAppender that hsRAMStream used before.