diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2019-01-02 17:38:38 +0100 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2019-01-02 17:38:38 +0100 |
commit | 904e73cbfa571377ab1860ba7d5a54119ab909e0 (patch) | |
tree | b3619b3066c1600bc117293d6d0d8d9beaeb26be /src/data/delimitedstringvalidator.h | |
parent | e090751ebb8e4c7c6a9075587e1017d4ac95cd05 (diff) |
added some documentation to the source code
Diffstat (limited to 'src/data/delimitedstringvalidator.h')
-rw-r--r-- | src/data/delimitedstringvalidator.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/data/delimitedstringvalidator.h b/src/data/delimitedstringvalidator.h index 654e4ab..b4ed3bd 100644 --- a/src/data/delimitedstringvalidator.h +++ b/src/data/delimitedstringvalidator.h @@ -19,6 +19,10 @@ /*! * A string validator which keeps curly braces matched. Used in various places * to ensure the user doesn't make non-parseable .tikz or .tikzstyles files. + * + * Its validation function will return Acceptable if all curly braces are matched + * properly, Intermediate if all braces are matched except for possibly some opening + * curly braces, and Invalid if there are unmatched closing curly braces. */ #ifndef DELIMITEDSTRINGVALIDATOR_H @@ -34,8 +38,18 @@ class DelimitedStringValidator : public QValidator public: DelimitedStringValidator(QObject *parent); QValidator::State validate(QString &input, int &/*pos*/) const override; + + /*! + * \brief fixup adds curly braces until all braces are matched (if possible) + * \param input + */ void fixup(QString &input) const override; private: + /*! + * \brief braceDepth computes the final (non-escaped) curly-brace depth of a given string + * \param input a string + * \return the final brace depth, or -1 if the depth *ever* drops below 0 + */ int braceDepth(QString input) const; }; |