From: Christian P. <cp...@se...> - 2004-12-18 14:39:26
|
Sure, it will be added. Thanks for your feedback, Christian Am Samstag 18 Dezember 2004 00:37 schrieb stephan beal: > Yo again: > > IORequest_Get::receive( char *, size_t ); > > Could i convince you guys to either: > > a) Add receive( std::string &, size_t ); > or > b) give me CVS write access so i can? (SF user == sgbeal) > > ?? > > It can be implemented in terms of the current receive() by passing a > vector<char> to the existing function, then simply copying the result > to a std::string. Something like: > > size_t receive( std::string & s, size_t count ) > { > typedef vector<char> VC; > VC v( count, '\0' ); > size_t ret = receive( &v[0], v.size() ); > s = std::string( v.begin(), v.begin() + ret ); > return ret; > } > > (achtung: untested) > > (achtung #2: when i find exciting code i send lots of mails. ;) |