Stream I/O (SDK)

3DS Max Plug-In SDK

Stream I/O (SDK)

MAXScript contains a number of character stream classes that are used primarily by the compiler and by the text I/O subsystem. These are all Value subclasses and so are first-class MAXScript values. If you want to call the compiler directly or pass or take stream values from scripts, you should use these classes.

The text file I/O classes and functions in MAXScript create and work on FileStream instances.

FileStream

FileStream::FileStream (); 

FileStream* open(char* file_name, char* mode); 

char get_char(); 

void unget_char(char c); 

char peek_char(); 

int at_eos(); 

void rewind(); 

void flush_to_eol(); 

char putch(char c); 

char* puts(char* str); 

int printf(const char *format, ...); 

void flush(); 

void close(); 

You can construct and pass StringStreams to the compiler if you want to compile pieces of source text.

StringStream

StringStream(char* init_string); 

StringStream(Value* init_string_value); 

StringStream(int ilen); 

 

void init(char* init_string); 

char* puts(char* str); 

char putch(char c); 

int printf(const char *format, ...);