#include <OutputStream.h>
類別TFileOutputStream的繼承圖:
公開方法(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 | ( | ) |
TFileOutputStream::TFileOutputStream | ( | int | ) |
TFileOutputStream::~TFileOutputStream | ( | ) |
void TFileOutputStream::Close | ( | void | ) | [virtual] |
關閉資料流,之後的寫入動作都沒有作用.
依據TOutputStream重新實作.
定義在 OutputStream.cpp 檔案之第 62 行.
參考 FlushCache(), 及 fout.
被參考於 Open(), 及 ~TFileOutputStream().
void TFileOutputStream::Flush | ( | void | ) | [virtual] |
void TFileOutputStream::FlushCache | ( | void | ) | [protected] |
bool TFileOutputStream::Open | ( | char * | ) |
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] |
FILE* TFileOutputStream::fout [protected] |
資料流的目標
定義在 OutputStream.h 檔案之第 26 行.
被參考於 Close(), Flush(), FlushCache(), Open(), Size(), TFileOutputStream(), 及 Write().