[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: RFC: escape strings in KConfigBase
From: Andreas Hartmetz <ahartmetz () gmail ! com>
Date: 2007-05-14 23:31:44
Message-ID: 200705150131.44510.ahartmetz () gmail ! com
[Download RAW message or body]
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic