diff options
author | Stijn Buys <ingar@osirion.org> | 2012-02-21 22:30:21 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-02-21 22:30:21 +0000 |
commit | 0392694560d530c14aced7ac21f85b18b676a685 (patch) | |
tree | 2410f58516767913b6fdd5f2efcdca9fb1155fc2 /src/inistream.h | |
parent | ba14d604adfee8b7596e0bfca81ad2720bbc0cf5 (diff) |
Initial support to preserve ini file comments
Diffstat (limited to 'src/inistream.h')
-rw-r--r-- | src/inistream.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/inistream.h b/src/inistream.h index 08a6ef4..5ff1237 100644 --- a/src/inistream.h +++ b/src/inistream.h @@ -31,17 +31,17 @@ public: bool getline(QTextStream &textstream); /// current section label - inline QString section() const { + inline const QString & section() const { return section_current; } /// current key - inline QString key() const { + inline const QString & key() const { return key_current; } /// current value - inline QString value() const { + inline const QString & value() const { return value_current; } @@ -49,6 +49,11 @@ public: inline unsigned int line() const { return line_number; } + + /// comment string for the current section or key/value pair + inline const QString & comment() const { + return comment_current; + } /// true if the last read statement was a section header bool got_section() const; @@ -94,6 +99,9 @@ private: QString section_current; QString key_current; QString value_current; + + QString comment_current; + QString comment_next; bool last_read_was_key; bool last_read_was_section; |