From: stephan b. <sg...@us...> - 2005-01-01 19:42:03
|
Update of /cvsroot/pclasses/pclasses/src/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10355 Modified Files: piorequest.cpp Log Message: added string form of receive() Index: piorequest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses/src/io/piorequest.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- piorequest.cpp 27 Feb 2004 02:09:46 -0000 1.1 +++ piorequest.cpp 1 Jan 2005 19:41:54 -0000 1.2 @@ -17,6 +17,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <string> +#include <vector> #include "pclasses/piorequest.h" namespace P { @@ -47,6 +49,20 @@ {} + +size_t +IORequest_Get::receive( std::string & buffer, size_t count ) +{ + typedef std::vector<char> VC; + VC v(count,'\0'); + size_t ret = this->receive( &v[0], count ); + buffer = (0 == ret) + ? "" + : std::string( v.begin(), v.begin() + ret ); + return ret; +} + + IORequest_Put::IORequest_Put(IOHandler* handler, const URL& url) : IORequest(handler,url) {} |