<?php

class StringWriter extends Object
{
  public $buffer = "";
  
  public function write($data)
  {
    $this->buffer .= $data;
  }
  
  public function writeline($data = "")
  {
    $this->write($data);
    $this->write(PHP_EOL);
  }
  
  public function html_writeline($data)
  {
    $this->write($data);
    $this->write("<br />");
    $this->write(PHP_EOL);
  }
  
  public function __toString()
  {
    return $this->buffer;
  }
}
