| 56 | } |
| 57 | |
| 58 | int pipe_string::pop_end(string* out, size_t max /* = 0 */) |
| 59 | { |
| 60 | if (out == NULL) { |
| 61 | return 0; |
| 62 | } |
| 63 | size_t n = m_pBuf->length(); |
| 64 | acl_assert(n >= m_pos); |
| 65 | n -= m_pos; |
| 66 | if (n == 0) { |
| 67 | return 0; |
| 68 | } |
| 69 | if (max > 0 && n > max) { |
| 70 | n = max; |
| 71 | } |
| 72 | out->append(m_pBuf->c_str() + m_pos, n); |
| 73 | m_pos += n; |
| 74 | return (int) n; |
| 75 | } |
| 76 | |
| 77 | //////////////////////////////////////////////////////////////////////// |
| 78 |
no test coverage detected