summaryrefslogtreecommitdiffstats
path: root/xbmc/utils/Literals.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/utils/Literals.h')
-rw-r--r--xbmc/utils/Literals.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/xbmc/utils/Literals.h b/xbmc/utils/Literals.h
new file mode 100644
index 0000000..ce567d5
--- /dev/null
+++ b/xbmc/utils/Literals.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2014-2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#pragma once
+
+constexpr unsigned long long int operator"" _kib (unsigned long long int val)
+{
+ return val * 1024ull;
+}
+
+constexpr unsigned long long int operator"" _kb (unsigned long long int val)
+{
+ return val * 1000ull;
+}
+
+constexpr unsigned long long int operator"" _mib (unsigned long long int val)
+{
+ return val * 1024ull * 1024ull;
+}
+
+constexpr unsigned long long int operator"" _mb (unsigned long long int val)
+{
+ return val * 1000ull * 1000ull;
+}