34 if (!fmt)
throw std::runtime_error(
"fmt in CStream::printf cannot be NULL");
36 int result = -1, length = 1024;
40 buffer.resize(length + 10);
45 result = ::vsnprintf_s(&buffer[0], length, _TRUNCATE, fmt, args);
47 result =
::vsnprintf(&buffer[0], length, fmt, args);
52 if (result >= length) result = -1;
56 size_t l = strlen(&buffer[0]);
57 this->Write(&buffer[0], (
int)l);
76 size_t N = out_str.size();
77 out_str.resize(N + 1);
78 if (!Read(&out_str[N], 1))
return false;
81 if (out_str[N] ==
'\r')
85 else if (out_str[N] ==
'\n')