<?php
/**
 * CodeIgniter report view
 *
 * @category CodeIgniter
 * @license /_licenses/untermStrich/agb_normal.pdf
 * @author Christian Koller
 * @copyright 2009 untermStrich
 * @package views
 * @version $Id$
*/

if (!defined('BASEPATH')) { exit('No direct script access allowed'); }

require_once APPPATH.'us_libraries/US_report_view_result.php';

/**
 * A view for XML
 */
class View_xml extends US_report_view_result
{

    /**
     * Process the report based on the view mode
     *
     * @param   integer $mode   One of the US_report_view_result::M_... modes
     * @return  mixed   Either void or the filename
     *
     * @see US_report_view_result::M_DIRECT
     * @see US_report_view_result::M_FILE
     */
    protected function process($mode)
    {

        if ($mode===US_report_view_result::M_FILE) {
            return $this->file_name;
        } else {
            Report::set_header($this->viewinfo);
            readfile($this->file_name);
        }

    }

} // END class View_xml
