/*
                              driver.cc
*/


#include <iostream>
#include <fstream>
#include <bobcat/multibuf>

using namespace std;
using namespace FBB;

int main()
{
    ofstream all("/tmp/all");
    ofstream part("/tmp/part");

    MultiBuf buf{ cout, part, all };
    ostream out{ &buf };

    buf.setOnce(part);

    out << "first line, also to part" << endl;
    out << "second line, not to part" << endl;

    buf.setOnce(part);

    out << "third line again also to part" << endl;

    buf.remove(part);

    out << "no more lines to part (1)" << endl;
    out << "no more lines to part (2)" << endl;

    MultiBuf demo1{ cout, MultiBuf::ON };
    MultiBuf demo2{ cout, MultiBuf::ON, cout, MultiBuf::ON };
}
