V
Vaca Louca
Hello,
I write an ISAPI authentication module which uses Berkeley DB and
want it to be as efficient as possible.
Both ISAPI and BerkeleyDB use arrays of chars (char *)
to pass and receive information.
I know that C++ strings are supposed to be the "right" way to
handle strings but I suspect that converting "char *" to string
every time I deal with it is costly (allocate memory, copy the
content), especially when many times I'll have to convert the
string back to "char *" (using c_str()) to pass it onward to the
other side or return a result.
Are there known class libraries which can help me somehow:
1. create an object which accepts a "char *" (either
null-terminated or with a length argument)
2. represent this array of chars as an STL container (provide
iterators, mostly, but also allow modification of the array
through the iterators)
3. provides a handle to the original "char *" argument
without copying over the array of bytes?
I googled around and Boost seems like a likely candidate, but its
documentation is a bit sporadic and I'm struggling to figure out
what and how to use it.
Thanks,
--V
I write an ISAPI authentication module which uses Berkeley DB and
want it to be as efficient as possible.
Both ISAPI and BerkeleyDB use arrays of chars (char *)
to pass and receive information.
I know that C++ strings are supposed to be the "right" way to
handle strings but I suspect that converting "char *" to string
every time I deal with it is costly (allocate memory, copy the
content), especially when many times I'll have to convert the
string back to "char *" (using c_str()) to pass it onward to the
other side or return a result.
Are there known class libraries which can help me somehow:
1. create an object which accepts a "char *" (either
null-terminated or with a length argument)
2. represent this array of chars as an STL container (provide
iterators, mostly, but also allow modification of the array
through the iterators)
3. provides a handle to the original "char *" argument
without copying over the array of bytes?
I googled around and Boost seems like a likely candidate, but its
documentation is a bit sporadic and I'm struggling to figure out
what and how to use it.
Thanks,
--V