2007年5月20日 星期日

Some C++ experience

1. type stringstream 的 member function
rdbuf Get/set the associated stringbuf object (public member function)

當呼叫過這一個rdbuf api 後, 原先stringstream 內的data 就會被刪除

str Get/set the associated string object (public member function)
如果只是想要顯示資料, 可以利用 str 這一個api 即可

至於其他的type, 如
ifstream
isstringstream
stream


ifstream public member functions
(constructor) Construct object and optionally open file (constructor member)
rdbuf Get the associated filebuf object (public member function)
is_open Check if a file is open (public member function)
open Open file (public member function)
close Close file (public member function)


istringstream public member functions
(constructor) Construct an object and optionally initialize its content (constructor member)
rdbuf Get/set the associated stringbuf object (public member function)
str Get/set the string content (public member function)

string

沒有留言: