std::ifstream 打开文件,获得文件流 并赋给std::string

摘要: // 打开文件,获得文件流 std::ifstream inFile(fileName.c_str(), std::ios::in | std::ios::binary); std::ostringstream oss; oss << inFile.rdbuf(); std::string buffer = oss.str(); inFile.close(); 阅读全文
posted @ 2011-05-20 18:32 几百人有爱 阅读(978) 评论(0) 推荐(0)

zlib 压缩文件

摘要: /*zlib 的z_stream结构*/typedef struct z_stream_s { Bytef *next_in; uInt avail_in; uLong total_in; Bytef *next_out; uInt avail_out; uLong total_out; char *msg; struct internal_state FAR *state; alloc_func zalloc; free_func zfree; voidp... 阅读全文
posted @ 2011-05-20 16:22 几百人有爱 阅读(723) 评论(0) 推荐(0)