TOutputHtmlFileStream.hh Source File

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

# TOutputHtmlFileStream.hh

解説を見る。

    00001 // =====================================================================
    00021 // =====================================================================
    00022 #ifndef __TOUTPUTHTMLFILESTREAM_HH
    00023 #define __TOUTPUTHTMLFILESTREAM_HH
    00024
    00025 #include "Tglobals.h"
    00026
    00027
    00047 class TOutputHtmlFileStream
    00048   : public Tofstream
    00049 {
    00050
    00051   public:
    00052     enum {
    00053       fopen = 0x01,
    00054       fclose = 0x02,
    00055       otable = 0x04,
    00056       ctable = 0x08,
    00057       wheader = 0x10,
    00058       wfooter = 0x20,
    00059       title = 0x40
    00060     };
    00061
    00062   protected:
    00063     Tint theStatus;
    00064     Tstring theTitle;
    00065     Tstring theFileName;
    00066
    00067   public:
    00068     TOutputHtmlFileStream();
    00069     TOutputHtmlFileStream( const Tstring& filename );
    00070     TOutputHtmlFileStream( const Tstring& filename, const Tstring& title );
    00071     ~TOutputHtmlFileStream();
    00072
    00073   public:
    00074     virtual TOutputHtmlFileStream& WriteHeader();
    00075     virtual TOutputHtmlFileStream& WriteFooter();
    00076     virtual TOutputHtmlFileStream& OpenTable();
    00077     virtual TOutputHtmlFileStream& CloseTable();
    00078
    00079   public:
    00080     Tbool IsOpen() const;
    00081     Tbool IsClose() const;
    00082     Tbool IsOpenTable() const;
    00083     Tbool IsCloseTable() const;
    00084     Tbool IsWrittenHeader() const;
    00085     Tbool IsWrittenFooter() const;
    00086     Tbool HasTitle() const;
    00087
    00088   public:
    00089     const Tstring& GetTitle() const;
    00090     Tint GetStatus() const;
    00091     const Tstring& GetFileName() const;
    00092     Tvoid SetTitle( const Tstring& title );
    00093     Tvoid SetStatus( Tint status );
    00094
    00095   public:
    00096     Tvoid Open( const Tstring& filename );
    00097     Tvoid Open( const Tstring& filename, const Tstring& title );
    00098     Tvoid Close();
    00099
    00100   protected:
    00101     Tint setStatusBit( Tint status );
    00102     Tint clearStatusBit( Tint status );
    00103
    00104 };
    00105
    00106 inline const Tstring& TOutputHtmlFileStream::GetTitle() const
    00107 {
    00108   return theTitle;
    00109 }
    00110
    00111 inline Tint TOutputHtmlFileStream::GetStatus() const
    00112 {
    00113   return theStatus;
    00114 }
    00115
    00116 inline const Tstring& TOutputHtmlFileStream::GetFileName() const
    00117 {
    00118   return theFileName;
    00119 }
    00120
    00121 inline Tvoid TOutputHtmlFileStream::SetTitle( const Tstring& title )
    00122 {
    00123   theTitle = title;
    00124   setStatusBit( TOutputHtmlFileStream::title );
    00125   return;
    00126 }
    00127
    00128 inline Tvoid TOutputHtmlFileStream::SetStatus( Tint status )
    00129 {
    00130   theStatus = status;
    00131   return;
    00132 }
    00133
    00134 inline Tint TOutputHtmlFileStream::setStatusBit( Tint status )
    00135 {
    00136   return theStatus |= status;
    00137 }
    00138
    00139 inline Tint TOutputHtmlFileStream::clearStatusBit( Tint status )
    00140 {
    00141   return theStatus &= ~status;
    00142 }
    00143
    00144 inline Tbool TOutputHtmlFileStream::IsOpen() const
    00145 {
    00146   return (Tbool)( theStatus & TOutputHtmlFileStream::fopen );
    00147 }
    00148
    00149 inline Tbool TOutputHtmlFileStream::IsClose() const
    00150 {
    00151   return (Tbool)( theStatus & TOutputHtmlFileStream::fclose );
    00152 }
    00153
    00154 inline Tbool TOutputHtmlFileStream::IsOpenTable() const
    00155 {
    00156   return (Tbool)( theStatus & TOutputHtmlFileStream::otable );
    00157 }
    00158
    00159 inline Tbool TOutputHtmlFileStream::IsCloseTable() const
    00160 {
    00161   return (Tbool)( theStatus & TOutputHtmlFileStream::ctable );
    00162 }
    00163
    00164 inline Tbool TOutputHtmlFileStream::IsWrittenHeader() const
    00165 {
    00166   return (Tbool)( theStatus & TOutputHtmlFileStream::wheader );
    00167 }
    00168
    00169 inline Tbool TOutputHtmlFileStream::IsWrittenFooter() const
    00170 {
    00171   return (Tbool)( theStatus & TOutputHtmlFileStream::wfooter );
    00172 }
    00173
    00174 inline Tbool TOutputHtmlFileStream::HasTitle() const
    00175 {
    00176   return (Tbool)( theStatus & TOutputHtmlFileStream::title );
    00177 }
    00178
    00179 #endif