Changeset View
Changeset View
Standalone View
Standalone View
debuggers/common/stringhelpers.h
Show All 27 Lines | |||||
28 | * @param index should be the index BEHIND the expression | 28 | * @param index should be the index BEHIND the expression | ||
29 | * */ | 29 | * */ | ||
30 | int expressionAt( const QString& contents, int index ); | 30 | int expressionAt( const QString& contents, int index ); | ||
31 | 31 | | |||
32 | QString quoteExpression(QString expr); | 32 | QString quoteExpression(QString expr); | ||
33 | 33 | | |||
34 | QString unquoteExpression(QString expr); | 34 | QString unquoteExpression(QString expr); | ||
35 | 35 | | |||
36 | /** | ||||
37 | * Qoute the string, using quoteCh | ||||
38 | */ | ||||
39 | QString quote(QString str, char quoteCh = '"'); | ||||
40 | | ||||
41 | /** | ||||
42 | * Unquote and optionally unescape unicode escape sequence. | ||||
43 | * Handle escape sequence | ||||
44 | * '\\' '\\' -> '\\' | ||||
45 | * '\\' quoteCh -> quoteCh | ||||
46 | * '\\' 'u' 'N' 'N' 'N' 'N' -> '\uNNNN' | ||||
47 | * '\\' 'x''N''N' -> '\xNN' | ||||
48 | */ | ||||
49 | QString unquote(const QString &str, bool unescapeUnicode = false, char quoteCh = '"'); | ||||
50 | | ||||
36 | } // end of namespace Utils | 51 | } // end of namespace Utils | ||
37 | 52 | | |||
38 | #endif // __STRINGHELPERS_H__ | 53 | #endif // __STRINGHELPERS_H__ |