#include "streams.h"
Functions | |
invisible_class(ReadonlyTextFileStream) class ReadonlyTextFileStream ScripterExport | ~ReadonlyTextFileStream () |
ReadonlyTextFileStream is only used for opening text file in read-only mode. More... | |
ScripterExport ReadonlyTextFileStream * | open (const MCHAR *ifile_name, unsigned int encoding=-1) |
Open a new text file. More... | |
MaxSDK::Util::Char | get_char () |
void | unget_char (const MaxSDK::Util::Char &c) |
MaxSDK::Util::Char | peek_char () |
int | at_eos () |
unsigned int | pos () |
void | seek (int pos) |
void | rewind () |
void | flush_to_eol () |
MaxSDK::Util::Char | putch (const MaxSDK::Util::Char &c) |
const MCHAR * | puts (const MCHAR *str) |
int | printf (const MCHAR *format,...) |
void | collect () |
void | close () |
void | gc_trace () |
void | log_to (CharStream *log) |
void | close_log () |
CharStream * | get_log () |
Variables | |
int | mUngetcharCount |
MaxSDK::Util::Char | mUngetcharBuf [8] |
MaxSDK::Util::Char * | mFileBuf |
size_t | mCharCount |
size_t | mCharPos |
CharStream * | mLog |
invisible_class (ReadonlyTextFileStream) class ReadonlyTextFileStream ScripterExport ~ReadonlyTextFileStream | ( | ) |
ReadonlyTextFileStream is only used for opening text file in read-only mode.
It's equivalent to use FileStream when opening files in "rt" mode. But FileStream is very slow when reading files. So we optimize the original codes in FileStream and create this new class which is thousand times faster for reading text files than FileStream.
ScripterExport ReadonlyTextFileStream* open | ( | const MCHAR * | ifile_name, |
unsigned int | encoding = -1 |
||
) |
Open a new text file.
[in] | ifile_name | The file name. |
[in] | encoding | The encoding to use if if can not be determined from the file contents, If -1, a default encoding based on the file language setting in Preference /Files (exposed through Interface14) will be used. |
MaxSDK::Util::Char get_char | ( | ) |
void unget_char | ( | const MaxSDK::Util::Char & | c | ) |
MaxSDK::Util::Char peek_char | ( | ) |
int at_eos | ( | ) |
unsigned int pos | ( | ) |
void rewind | ( | ) |
void flush_to_eol | ( | ) |
MaxSDK::Util::Char putch | ( | const MaxSDK::Util::Char & | c | ) |
void collect | ( | ) |
void close | ( | ) |
void gc_trace | ( | ) |
void log_to | ( | CharStream * | log | ) |
void close_log | ( | ) |
CharStream* get_log | ( | ) |
int mUngetcharCount |
MaxSDK::Util::Char mUngetcharBuf[8] |
MaxSDK::Util::Char* mFileBuf |
size_t mCharCount |
size_t mCharPos |
CharStream* mLog |