Parse a connection string into option keys and their values.
This is a class and not a function for just one reason: the outputs contain pointers to storage that needs to be held in memory.
| std::array< std::vector< char const * >, 2u > pqxx::internal::connection_string_parser::parse |
( |
| ) |
const |
Parse the string, return matching vectors of option names & values.
The two vectors are of equal length. The first holds the option names and the second their respective values.
The outputs remain valid only for as long as the whole connection_string_parser does. You can call parse() as many times as you like. The calls will produce distinct outputs but the ultimate string pointers will be the same, and in the same order.
The vectors will only contain values that were actually specified (as opposed to ones that were left to their defaults), but they will have enough room reserved to specify all possible options, plus a terminating null that we may need to add.