From: Dean M. B. <mik...@gm...> - 2011-02-01 14:11:40
|
On Tue, Feb 1, 2011 at 3:49 AM, David Hite <dav...@gm...> wrote: > > On Mon, Jan 31, 2011 at 12:09 PM, Nelson, Erik - 2 > <eri...@ba...> wrote: > > Hey Erik, > Good point! I agree. vector<char> seems to be a good standard. Actually what would be better would a vector<uint8_t> so you don't miss the 8-bit goodness of the data but that's beside the point. ;) > In fact, it > looks like vector<char> is (or will be) the mandated underlying storage > container for std::string. > Yeah, unfortunately. But that's another discussion. :P > For info, here's what I have working. It seems the easy pitfall is using > assignment operator "=" with a char* buffer for a string assumes NULL > terminated string. The alternative is to use the string constructor with a > char* and size. > > Here's the code to load binary files (i.e. images) and serve with > synchronous server. > Thanks David! :) Would you mind contributing this as an example to the project? :D Have a good one and I hope to hear from you again soon! :) -- Dean Michael Berris about.me/deanberris |