#include <InputStream.h>
類別TFileInputStream的繼承圖:
公開方法(Public Methods) | |
TFileInputStream () | |
建構子,預設cache大小為1024個byte | |
TFileInputStream (int) | |
建構子,設定cache大小為cs個byte | |
~TFileInputStream () | |
bool | Open (char *) |
用binary模式開啟檔案。fname為讀取的檔案名稱,傳回開啟成功或失敗 | |
int | Available (void) |
傳回目前有多少個byte資料可供讀取 | |
void | Close (void) |
關閉資料流. | |
int | Position (void) |
傳回目前讀取到整個資料流的第幾個byte。若呼叫Close再呼叫此函式會傳回0 | |
int | Read (void) |
從資料流讀取一個byte並傳回。若已經到達資料流結尾,或呼叫Close,再呼叫此函式會傳回-1 | |
void | Reset (void) |
將讀取的位置移到資料流開頭 | |
int | Skip (int) |
略過size個byte的資料,並傳回實際上略過的byte數 | |
保護屬性 | |
FILE * | fin |
資料流的來源 | |
unsigned char * | cache |
當讀取資料時,會先從檔案讀取一段資料到cache裡,接下來的讀取動作則是從cache傳出資料 | |
int | position |
目前讀取到檔案的第幾個byte | |
int | available |
還有多少byte資料可供讀取. | |
int | cacheSize |
cache的大小 | |
int | cacheIndex |
目前讀取到cache的第幾個byte資料 | |
int | cacheDataSize |
目前cache裡有多少byte資料 |
定義在 InputStream.h 檔案之第 25 行.
TFileInputStream::TFileInputStream | ( | ) |
TFileInputStream::TFileInputStream | ( | int | ) |
TFileInputStream::~TFileInputStream | ( | ) |
int TFileInputStream::Available | ( | void | ) | [virtual] |
void TFileInputStream::Close | ( | void | ) | [virtual] |
關閉資料流.
依據TInputStream重新實作.
定義在 InputStream.cpp 檔案之第 73 行.
參考 available, fin, 及 position.
被參考於 Open(), 及 ~TFileInputStream().
bool TFileInputStream::Open | ( | char * | ) |
int TFileInputStream::Position | ( | void | ) | [virtual] |
傳回目前讀取到整個資料流的第幾個byte。若呼叫Close再呼叫此函式會傳回0
實作 TInputStream.
定義在 InputStream.cpp 檔案之第 81 行.
參考 position.
int TFileInputStream::Read | ( | void | ) | [virtual] |
從資料流讀取一個byte並傳回。若已經到達資料流結尾,或呼叫Close,再呼叫此函式會傳回-1
實作 TInputStream.
定義在 InputStream.cpp 檔案之第 86 行.
參考 available, cache, cacheDataSize, cacheIndex, cacheSize, fin, 及 position.
void TFileInputStream::Reset | ( | void | ) | [virtual] |
將讀取的位置移到資料流開頭
依據TInputStream重新實作.
定義在 InputStream.cpp 檔案之第 101 行.
參考 available, cacheDataSize, cacheIndex, fin, 及 position.
被參考於 Open(), 及 TFileInputStream().
int TFileInputStream::Skip | ( | int | ) | [virtual] |
略過size個byte的資料,並傳回實際上略過的byte數
實作 TInputStream.
定義在 InputStream.cpp 檔案之第 115 行.
參考 available, cacheDataSize, cacheIndex, fin, 及 position.
int TFileInputStream::available [protected] |
unsigned char* TFileInputStream::cache [protected] |
當讀取資料時,會先從檔案讀取一段資料到cache裡,接下來的讀取動作則是從cache傳出資料
定義在 InputStream.h 檔案之第 29 行.
被參考於 Read(), TFileInputStream(), 及 ~TFileInputStream().
int TFileInputStream::cacheDataSize [protected] |
int TFileInputStream::cacheIndex [protected] |
int TFileInputStream::cacheSize [protected] |
FILE* TFileInputStream::fin [protected] |
資料流的來源
定義在 InputStream.h 檔案之第 28 行.
被參考於 Close(), Open(), Read(), Reset(), Skip(), 及 TFileInputStream().
int TFileInputStream::position [protected] |