MCPcopy Create free account
hub / github.com/THUNLP-MT/MEAN / empty_buffer

Method empty_buffer

evaluation/TMscore.cpp:2005–2021  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2003 */
2004 template <typename C, typename T>
2005 bool
2006 basic_pstreambuf<C,T>::empty_buffer()
2007 {
2008 const std::streamsize count = this->pptr() - this->pbase();
2009 if (count > 0)
2010 {
2011 const std::streamsize written = this->write(this->wbuffer_, count);
2012 if (written > 0)
2013 {
2014 if (const std::streamsize unwritten = count - written)
2015 traits_type::move(this->pbase(), this->pbase()+written, unwritten);
2016 this->pbump(-written);
2017 return true;
2018 }
2019 }
2020 return false;
2021 }
2022
2023 /**
2024 * Called when the internal character buffer is is empty, to re-fill it

Callers

nothing calls this directly

Calls 1

writeMethod · 0.95

Tested by

no test coverage detected