diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2023-06-28 14:52:43 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2023-07-05 12:56:55 +0200 |
| commit | af32768f18f8fed1ce3d06a6bad5fd65d0574a3a (patch) | |
| tree | ed5257b35ceedbec428de54be83ee32c9533d0dd /src/corelib/io/qdebug.h | |
| parent | e090853ad598aa4f39304d69ec29b80fc3fceb62 (diff) | |
QDebug: add getter/setter for noQuotes
There were setters (quote(), noquote()), but, unlike
space()/nospace(), there was no getter.
Add the getter, and, for symmetry, a parametrized setter, too.
[ChangeLog][QtCore][QDebug] Added setQuoteStrings()/quoteStrings() to
access and manipulate the quote()/noquote() state.
Change-Id: I1b73138819b4d02726a6ef862c190206431ccebc
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qdebug.h')
| -rw-r--r-- | src/corelib/io/qdebug.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 7390a9c8bce..39f706b0648 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -93,6 +93,9 @@ public: bool autoInsertSpaces() const { return stream->space; } void setAutoInsertSpaces(bool b) { stream->space = b; } + [[nodiscard]] bool quoteStrings() const noexcept { return !stream->noQuotes; } + void setQuoteStrings(bool b) { stream->noQuotes = !b; } + inline QDebug "e() { stream->noQuotes = false; return *this; } inline QDebug &noquote() { stream->noQuotes = true; return *this; } inline QDebug &maybeQuote(char c = '"') { if (!stream->noQuotes) stream->ts << c; return *this; } |
