34 _handle = popen(command.c_str(),
"r");
38 setp( &m_buf[0], &m_buf[0] + (m_buf.size() - 1) );
39 _handle = popen(command.c_str(),
"w");
55 return std::char_traits<char>::eof();
57 ret = fread(&m_buf[0],
sizeof(
char), m_buf.size(), _handle);
61 setg(&m_buf[0], &m_buf[0], &m_buf[0] + ret);
63 return std::char_traits<char>::not_eof((
unsigned char) m_buf[0]);
68 int ret = std::char_traits<char>::eq_int_type(this->
overflow(std::char_traits<char>::eof()),
69 std::char_traits<char>::eof()) ? -1 : 0;
76 char *ibegin = pbase();
80 if ( iend <= ibegin )
return std::char_traits<char>::not_eof(m);
83 setp( &m_buf[0], &m_buf[0] + (m_buf.size() - 1) );
85 if(!std::char_traits<char>::eq_int_type(m, std::char_traits<char>::eof())) {
86 *iend++ = std::char_traits<char>::to_char_type(m);
89 const size_t avail_data = (iend - ibegin);
92 if (fwrite(ibegin,
sizeof(
char), avail_data, _handle) != avail_data)
94 return std::char_traits<char>::eof();
97 return std::char_traits<char>::not_eof(m);