RFC: escape strings in KConfigBase

Andreas Hartmetz ahartmetz at gmail.com
Tue May 15 00:31:44 BST 2007


Hello list,

I noticed that KConfigBase has some "forbidden" chars in certain fields, 
quote:
"the '=' char is not allowed in keys and the ']' char is not allowed in a 
group name."
...and another char, ',' by default, is also forbidden if you want to use the 
(very convenient) list read/write functions.
This is not state of the art, dangerous (who knows which strings happen to 
turn up in your config file), and cumbersome.
I can come up with three possible solutions:
- Auto-escape all strings, using the backslash notation if nothing better 
(i.e. faster to parse and still human readable) exists.
- Provide an escape function that takes the chars to escape as a parameter
- Add Escape/NoEscape as flags to the write/read functions.

This is not a theoretical issue, at least not for me, because I want to store 
some user supplied strings in a config file.

Please comment!

Cheers,
Andreas




More information about the kde-core-devel mailing list