Re: [Strmod-devel] Using the StrChunk iterator
Status: Alpha
Brought to you by:
omnifarious
From: Eric M. H. <ho...@om...> - 2003-08-06 20:16:12
|
On Fri, 2003-08-01 at 17:42, Jim Hodapp wrote: > Eric, >=20 > How exactly do I use the StrChunk iterator to iterate through the > incoming_ StrChunk in processIncoming()? I want to get potential > incoming data out so I can analyze it, cout it to the screen, do > comparisons, etc. Then, how do I connect my processIncoming() code to > actually hook into the incoming accepted connection(s) that the program > might establish? Hopefully I can catch you online in #sockets. The easiest way to do this is to copy the StrChunk into a string. This isn't very efficient, but will get you going. The code to copy the contents of a StrChunk into an STL string looks something like this: StrChunkPtr chunkptr =3D incoming_; ::std::string chunkstr(chunkptr->begin(), chunkptr->end()); This will construct a new STL string, chunkstr, that will contain the contents of the StrChunk pointed to by incoming_. Then you can manipulate the data using standard string operations. There are better ways to do this, but that's the easiest to code and understand. Have fun (if at all possible), -- There's an excellent C/C++/Python/Unix/Linux programmer with a wide range of other experience and system admin skills who needs work. Namely, me. http://www.omnifarious.org/~hopper/resume.html -- Eric Hopper <ho...@om...> |