/*
 Bu::TeeStream::* Copyright (C) 2007-2023 Xagasoft, All rights reserved.
 Bu::TeeStream::*
 Bu::TeeStream::* This file is part of the libbu++ library and is released under the
 Bu::TeeStream::* terms of the license contained in the file LICENSE.
 Bu::TeeStream::*/

#include "bu/teestream.h"

Bu::TeeStream::TeeStream()
{
}

Bu::TeeStream::~TeeStream()
{
}

void Bu::TeeStream::addStream( Bu::Stream &rStream )
{
    lStream.append( StreamWrapper( rStream ) );
}

#define delegate \
    for( StreamRefList::iterator i = lStream.begin(); i; i++ ) \
        (*i).rStream

void Bu::TeeStream::close()
{
    delegate.close();
}

Bu::size Bu::TeeStream::tell()
{
    return 0;
}

void Bu::TeeStream::seek( Bu::size )
{
}

void Bu::TeeStream::setPos( Bu::size )
{
}

void Bu::TeeStream::setPosEnd( Bu::size )
{
}

bool Bu::TeeStream::isEos()
{
    return false;
}

bool Bu::TeeStream::isOpen()
{
    return true;
}

void Bu::TeeStream::flush()
{
    delegate.flush();
}

bool Bu::TeeStream::canRead()
{
    return false;
}

bool Bu::TeeStream::canWrite()
{
    return true;
}

bool Bu::TeeStream::isReadable()
{
    return false;
}

bool Bu::TeeStream::isWritable()
{
    return true;
}

bool Bu::TeeStream::isSeekable()
{
    return false;
}

bool Bu::TeeStream::isBlocking()
{
    return true;
}

void Bu::TeeStream::setBlocking( bool bBlocking )
{
    delegate.setBlocking( bBlocking );
}

void Bu::TeeStream::setSize( Bu::size )
{
}

Bu::size Bu::TeeStream::getSize() const
{
    return 0;
}

Bu::size Bu::TeeStream::getBlockSize() const
{
    return 0;
}

Bu::String Bu::TeeStream::getLocation() const
{
    return "Invalid";
}

