summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qtools_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qtools_p.h')
-rw-r--r--src/corelib/tools/qtools_p.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/tools/qtools_p.h b/src/corelib/tools/qtools_p.h
index 320423d703..9efd964205 100644
--- a/src/corelib/tools/qtools_p.h
+++ b/src/corelib/tools/qtools_p.h
@@ -70,6 +70,16 @@ Q_DECL_CONSTEXPR inline int fromHex(uint c) Q_DECL_NOTHROW
((c >= 'a') && (c <= 'f')) ? c - 'a' + 10 :
/* otherwise */ -1;
}
+
+Q_DECL_CONSTEXPR inline char toOct(uint value) Q_DECL_NOTHROW
+{
+ return '0' + char(value & 0x7);
+}
+
+Q_DECL_CONSTEXPR inline int fromOct(uint c) Q_DECL_NOTHROW
+{
+ return ((c >= '0') && (c <= '7')) ? c - '0' : -1;
+}
}
// We typically need an extra bit for qNextPowerOfTwo when determining the next allocation size.