34 if (!fmt)
throw std::runtime_error(
"fmt in CStream::printf cannot be NULL");
36 int result = -1,
length = 1024;
45 result = ::vsnprintf_s(&
buffer[0],
length, _TRUNCATE, 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')
virtual int printf(const char *fmt,...) MRPT_printf_format_check(2
Writes a string to the stream in a textual form.
GLsizei const GLchar ** string
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLuint GLsizei GLsizei * length
bool getline(std::string &out_str)
Reads from the stream until a ' ' character is found ('' characters are ignored). ...