TFileOutputStream 類別 參考文件

#include <OutputStream.h>

類別TFileOutputStream的繼承圖:

TOutputStream 全部成員列表

公開方法(Public Methods)

 TFileOutputStream ()
 建構子,預設cache大小為1024個byte
 TFileOutputStream (int)
 建構子,設定cache大小為cs個byte
 ~TFileOutputStream ()
bool Open (char *)
 用binary模式開啟檔案。fname為寫入的檔案名稱,傳回是否開啟成功
void Close (void)
 關閉資料流,之後的寫入動作都沒有作用.
void Flush (void)
 強迫將寫入的資料真的寫進去
int Size (void)
 傳回目前資料流的byte數。若呼叫Close再呼叫此函式會傳回0
void Write (int)
 寫一個byte到資料流

保護方法(Protected Methods)

void FlushCache (void)
 將cache中的資料寫到檔案裡

保護屬性

FILE * fout
 資料流的目標
unsigned char * cache
 寫入的資料會先寫到cache裡,等cache滿了才真的寫到檔案裡
int cacheSize
 cache的大小
int cacheDataSize
 目前cache裡已經有多少byte資料

詳細描述

資料流的目標是一個檔案

定義在 OutputStream.h 檔案之第 23 行.


建構子與解構子說明文件

TFileOutputStream::TFileOutputStream (  ) 

建構子,預設cache大小為1024個byte

定義在 OutputStream.cpp 檔案之第 32 行.

參考 cache, cacheDataSize, cacheSize, 及 fout.

TFileOutputStream::TFileOutputStream ( int   ) 

建構子,設定cache大小為cs個byte

定義在 OutputStream.cpp 檔案之第 40 行.

參考 cache, cacheDataSize, cacheSize, 及 fout.

TFileOutputStream::~TFileOutputStream (  ) 

定義在 OutputStream.cpp 檔案之第 48 行.

參考 cache, 及 Close().


函式成員說明文件

void TFileOutputStream::Close ( void   )  [virtual]

關閉資料流,之後的寫入動作都沒有作用.

依據TOutputStream重新實作.

定義在 OutputStream.cpp 檔案之第 62 行.

參考 FlushCache(), 及 fout.

被參考於 Open(), 及 ~TFileOutputStream().

void TFileOutputStream::Flush ( void   )  [virtual]

強迫將寫入的資料真的寫進去

依據TOutputStream重新實作.

定義在 OutputStream.cpp 檔案之第 72 行.

參考 FlushCache(), 及 fout.

void TFileOutputStream::FlushCache ( void   )  [protected]

將cache中的資料寫到檔案裡

定義在 OutputStream.cpp 檔案之第 96 行.

參考 cache, cacheDataSize, 及 fout.

被參考於 Close(), Flush(), 及 Write().

bool TFileOutputStream::Open ( char *   ) 

用binary模式開啟檔案。fname為寫入的檔案名稱,傳回是否開啟成功

定義在 OutputStream.cpp 檔案之第 54 行.

參考 Close(), 及 fout.

int TFileOutputStream::Size ( void   )  [virtual]

傳回目前資料流的byte數。若呼叫Close再呼叫此函式會傳回0

實作 TOutputStream.

定義在 OutputStream.cpp 檔案之第 81 行.

參考 cacheDataSize, 及 fout.

void TFileOutputStream::Write ( int   )  [virtual]

寫一個byte到資料流

實作 TOutputStream.

定義在 OutputStream.cpp 檔案之第 86 行.

參考 cache, cacheDataSize, cacheSize, FlushCache(), 及 fout.


資料成員說明文件

unsigned char* TFileOutputStream::cache [protected]

寫入的資料會先寫到cache裡,等cache滿了才真的寫到檔案裡

定義在 OutputStream.h 檔案之第 27 行.

被參考於 FlushCache(), TFileOutputStream(), Write(), 及 ~TFileOutputStream().

int TFileOutputStream::cacheDataSize [protected]

目前cache裡已經有多少byte資料

定義在 OutputStream.h 檔案之第 29 行.

被參考於 FlushCache(), Size(), TFileOutputStream(), 及 Write().

int TFileOutputStream::cacheSize [protected]

cache的大小

定義在 OutputStream.h 檔案之第 28 行.

被參考於 TFileOutputStream(), 及 Write().

FILE* TFileOutputStream::fout [protected]

資料流的目標

定義在 OutputStream.h 檔案之第 26 行.

被參考於 Close(), Flush(), FlushCache(), Open(), Size(), TFileOutputStream(), 及 Write().


此類別(class) 文件是由下列檔案中產生:
產生日期:Tue Jul 11 11:52:19 2006, 專案:cbmr, 產生器:  doxygen 1.4.7