MCPcopy Create free account
hub / github.com/acl-dev/acl / update

Method update

lib_acl_cpp/src/stdlib/pipe_stream.cpp:123–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123bool pipe_manager::update(const char* src, size_t len,
124 pipe_stream* out /* = NULL */)
125{
126 std::list<pipe_stream*>::iterator it = m_streams.begin();
127
128 string* pBuf = m_pBuf1;
129 string* pLast = pBuf;
130 pBuf->clear();
131
132 for (; it != m_streams.end(); ++it) {
133 if (len > 0 && (*it)->push_pop(src, len, pBuf, 0) == -1) {
134 return false;
135 }
136 src = pBuf->c_str();
137 len = pBuf->length();
138 pLast = pBuf;
139 if (pBuf == m_pBuf1) {
140 pBuf = m_pBuf2;
141 } else {
142 pBuf = m_pBuf1;
143 }
144 pBuf->clear();
145 }
146
147 if (!pLast->empty() && out != NULL) {
148 return out->push_pop(pLast->c_str(),
149 pLast->length(), NULL, 0) != -1;
150 }
151 return true;
152}
153
154bool pipe_manager::update_end(pipe_stream* out /* = NULL */)
155{

Callers

nothing calls this directly

Calls 7

beginMethod · 0.80
clearMethod · 0.45
endMethod · 0.45
push_popMethod · 0.45
c_strMethod · 0.45
lengthMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected