TOutputHtmlFileStream.hh Source File

メインページ モジュール クラス階層 アルファベット順一覧 構成 ファイル一覧 構成メンバ ファイルメンバ 関連ページ

# TOutputHtmlFileStream.hh

解説を見る。

    00001 // =====================================================================
    00002 //  $Id: TOutputHtmlFileStream.hh,v 1.2 2003/07/04 15:18:28 goiwai Exp $
    00003 //  $Name: CLDAQ-1-06-00 $
    00004 // =====================================================================
    00005 #ifndef __TOUTPUTHTMLFILESTREAM_HH
    00006 #define __TOUTPUTHTMLFILESTREAM_HH
    00007
    00008 #include "Tglobals.h"
    00009
    00010 class TOutputHtmlFileStream
    00011   : public Tofstream
    00012 {
    00013
    00014   public:
    00015     enum {
    00016       fopen = 0x01,
    00017       fclose = 0x02,
    00018       otable = 0x04,
    00019       ctable = 0x08,
    00020       wheader = 0x10,
    00021       wfooter = 0x20,
    00022       title = 0x40
    00023     };
    00024
    00025   protected:
    00026     Tint theStatus;
    00027     Tstring theTitle;
    00028     Tstring theFileName;
    00029
    00030   public:
    00031     TOutputHtmlFileStream();
    00032     TOutputHtmlFileStream( const Tstring& filename );
    00033     TOutputHtmlFileStream( const Tstring& filename, const Tstring& title );
    00034     ~TOutputHtmlFileStream();
    00035
    00036   public:
    00037     virtual TOutputHtmlFileStream& WriteHeader();
    00038     virtual TOutputHtmlFileStream& WriteFooter();
    00039     virtual TOutputHtmlFileStream& OpenTable();
    00040     virtual TOutputHtmlFileStream& CloseTable();
    00041
    00042   public:
    00043     Tbool IsOpen() const;
    00044     Tbool IsClose() const;
    00045     Tbool IsOpenTable() const;
    00046     Tbool IsCloseTable() const;
    00047     Tbool IsWrittenHeader() const;
    00048     Tbool IsWrittenFooter() const;
    00049     Tbool HasTitle() const;
    00050
    00051   public:
    00052     const Tstring& GetTitle() const;
    00053     Tint GetStatus() const;
    00054     const Tstring& GetFileName() const;
    00055     Tvoid SetTitle( const Tstring& title );
    00056     Tvoid SetStatus( Tint status );
    00057
    00058   public:
    00059     Tvoid Open( const Tstring& filename );
    00060     Tvoid Open( const Tstring& filename, const Tstring& title );
    00061     Tvoid Close();
    00062
    00063   protected:
    00064     Tint setStatusBit( Tint status );
    00065     Tint clearStatusBit( Tint status );
    00066
    00067 };
    00068
    00069 inline const Tstring& TOutputHtmlFileStream::GetTitle() const
    00070 {
    00071   return( theTitle );
    00072 }
    00073
    00074 inline Tint TOutputHtmlFileStream::GetStatus() const
    00075 {
    00076   return( theStatus );
    00077 }
    00078
    00079 inline const Tstring& TOutputHtmlFileStream::GetFileName() const
    00080 {
    00081   return( theFileName );
    00082 }
    00083
    00084 inline Tvoid TOutputHtmlFileStream::SetTitle( const Tstring& title )
    00085 {
    00086   theTitle = title;
    00087   setStatusBit( TOutputHtmlFileStream::title );
    00088   return;
    00089 }
    00090
    00091 inline Tvoid TOutputHtmlFileStream::SetStatus( Tint status )
    00092 {
    00093   theStatus = status;
    00094   return;
    00095 }
    00096
    00097 inline Tint TOutputHtmlFileStream::setStatusBit( Tint status )
    00098 {
    00099   return( theStatus |= status );
    00100 }
    00101
    00102 inline Tint TOutputHtmlFileStream::clearStatusBit( Tint status )
    00103 {
    00104   return( theStatus &= ~status );
    00105 }
    00106
    00107 inline Tbool TOutputHtmlFileStream::IsOpen() const
    00108 {
    00109   return( (Tbool)( theStatus & TOutputHtmlFileStream::fopen ) );
    00110 }
    00111
    00112 inline Tbool TOutputHtmlFileStream::IsClose() const
    00113 {
    00114   return( (Tbool)( theStatus & TOutputHtmlFileStream::fclose ) );
    00115 }
    00116
    00117 inline Tbool TOutputHtmlFileStream::IsOpenTable() const
    00118 {
    00119   return( (Tbool)( theStatus & TOutputHtmlFileStream::otable ) );
    00120 }
    00121
    00122 inline Tbool TOutputHtmlFileStream::IsCloseTable() const
    00123 {
    00124   return( (Tbool)( theStatus & TOutputHtmlFileStream::ctable ) );
    00125 }
    00126
    00127 inline Tbool TOutputHtmlFileStream::IsWrittenHeader() const
    00128 {
    00129   return( (Tbool)( theStatus & TOutputHtmlFileStream::wheader ) );
    00130 }
    00131
    00132 inline Tbool TOutputHtmlFileStream::IsWrittenFooter() const
    00133 {
    00134   return( (Tbool)( theStatus & TOutputHtmlFileStream::wfooter ) );
    00135 }
    00136
    00137 inline Tbool TOutputHtmlFileStream::HasTitle() const
    00138 {
    00139   return( (Tbool)( theStatus & TOutputHtmlFileStream::title ) );
    00140 }
    00141
    00142 #endif