Added some more stream members
authorMatthew Leibowitz <mattleibow@live.com>
Tue, 21 Mar 2017 14:56:06 +0000 (10:56 -0400)
committerMatthew Leibowitz <mattleibow@live.com>
Tue, 21 Mar 2017 14:56:06 +0000 (10:56 -0400)
include/c/sk_stream.h
src/c/sk_stream.cpp

index ac43f49..a3c19eb 100644 (file)
@@ -58,6 +58,9 @@ SK_C_API void sk_filewstream_destroy(sk_wstream_filestream_t* cstream);
 
 SK_C_API sk_wstream_dynamicmemorystream_t* sk_dynamicmemorywstream_new(void);
 SK_C_API sk_stream_asset_t* sk_dynamicmemorywstream_detach_as_stream(sk_wstream_dynamicmemorystream_t* cstream);
+SK_C_API sk_data_t* sk_dynamicmemorywstream_detach_as_data(sk_wstream_dynamicmemorystream_t* cstream);
+SK_C_API void sk_dynamicmemorywstream_copy_to(sk_wstream_dynamicmemorystream_t* cstream, void* data);
+SK_C_API void sk_dynamicmemorywstream_write_to_stream(sk_wstream_dynamicmemorystream_t* cstream, sk_wstream_t* dst);
 SK_C_API void sk_dynamicmemorywstream_destroy(sk_wstream_dynamicmemorystream_t* cstream);
 
 ////////////////////////////////////////////////////////////////////////////////
index a76d177..b554202 100644 (file)
@@ -155,6 +155,21 @@ sk_stream_asset_t* sk_dynamicmemorywstream_detach_as_stream(sk_wstream_dynamicme
     return ToStreamAsset(AsDynamicMemoryWStream(cstream)->detachAsStream());
 }
 
+sk_data_t* sk_dynamicmemorywstream_detach_as_data(sk_wstream_dynamicmemorystream_t* cstream)
+{
+    return ToData(AsDynamicMemoryWStream(cstream)->detachAsData().release());
+}
+
+void sk_dynamicmemorywstream_copy_to(sk_wstream_dynamicmemorystream_t* cstream, void* data)
+{
+    AsDynamicMemoryWStream(cstream)->copyTo(data);
+}
+
+void sk_dynamicmemorywstream_write_to_stream(sk_wstream_dynamicmemorystream_t* cstream, sk_wstream_t* dst)
+{
+    AsDynamicMemoryWStream(cstream)->writeToStream(AsWStream(dst));
+}
+
 bool sk_wstream_write(sk_wstream_t* cstream, const void* buffer, size_t size)
 {
     return AsWStream(cstream)->write(buffer, size);