
On 12/6/06, Jarrad Waterloo <jwaterloo@dynamicquest.com> wrote:
I'm not convinced. First of all, std::map is nothing special. Why not unordered_map? It would be probably better to provide a dedicated helper function that takes the map and build the string from it. Second, some servers don't expect key=value pairs, there might be something entirely different (for example, SQLite3 expects just a filename).
Std::map was just an example. Whether it is map, unordered_map, vector of name value tuples, it is all the same to me as an object oriented consistent approach to access and build the parameters for a session. This could even be a helper class though I would imagine that the api layer itself might like it in a structured approach so that it wouldn't have to parse it in order to format it correctly. Then again I am a user and not library implementer and just looking for this functionality which is also commonly found in ODBC?,OLEDB,ADO,JDBC and ADO.NET.
Why not an input iterator range? You could fairly easily check if the value_type was a pair and convert stream into the string as name=value in that case (maybe not including the = if the value's string is empty) or just stream it straight into the string with spaces between if it's not a pair. I suppose an arbitrary container would also work. ~ Scott