File Index Symbol Index

/*********************************************************************** Author: Zihan Chen (vczh) Licensed under https://github.com/vczh-libraries/License ***********************************************************************/
#include <string.h>
#include "BroadcastStream.h"
namespace
vl
{
namespace
stream
{
/*********************************************************************** BroadcastStream ***********************************************************************/
BroadcastStream
::
BroadcastStream
() :closed(
false
) ,position(
0
) { }
BroadcastStream
::
~
BroadcastStream
() { }
BroadcastStream
::
StreamList
&
BroadcastStream
::
Targets
() {
return
streams
; }
bool
BroadcastStream
::
CanRead
()
const
{
return
false
; }
bool
BroadcastStream
::
CanWrite
()
const
{
return
!
closed
; }
bool
BroadcastStream
::
CanSeek
()
const
{
return
false
; }
bool
BroadcastStream
::
CanPeek
()
const
{
return
false
; }
bool
BroadcastStream
::
IsLimited
()
const
{
return
false
; }
bool
BroadcastStream
::
IsAvailable
()
const
{
return
!
closed
; }
void
BroadcastStream
::
Close
() {
closed
=
true
;
position
=-
1
; }
pos_t
BroadcastStream
::
Position
()
const
{
return
position
; }
pos_t
BroadcastStream
::
Size
()
const
{
return
position
; }
void
BroadcastStream
::
Seek
(
pos_t
_size
) { }
void
BroadcastStream
::
SeekFromBegin
(
pos_t
_size
) { }
void
BroadcastStream
::
SeekFromEnd
(
pos_t
_size
) { }
vint
BroadcastStream
::
Read
(
void
*
_buffer
,
vint
_size
) { }
vint
BroadcastStream
::
Write
(
void
*
_buffer
,
vint
_size
) {
for
(
vint
i
=
0
;
i
<
streams
.
Count
();
i
++) {
vint
written
=
streams
[
i
]->
Write
(
_buffer
,
_size
); }
position
+=
_size
;
return
_size
; }
vint
BroadcastStream
::
Peek
(
void
*
_buffer
,
vint
_size
) { } } }