aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libother/number.h
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/tests/libother/number.h')
-rw-r--r--sources/shiboken6/tests/libother/number.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libother/number.h b/sources/shiboken6/tests/libother/number.h
new file mode 100644
index 000000000..2c480e7f2
--- /dev/null
+++ b/sources/shiboken6/tests/libother/number.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#ifndef NUMBER_H
+#define NUMBER_H
+
+#include "libothermacros.h"
+#include "str.h"
+#include "point.h"
+#include "complex.h"
+
+class LIBOTHER_API Number
+{
+public:
+ explicit Number(int value) : m_value(value) {};
+ inline int value() const { return m_value; }
+
+ Str toStr() const;
+ inline operator Str() const { return toStr(); }
+
+ friend LIBOTHER_API Point operator*(const Point &, const Number &);
+
+ Complex toComplex() const;
+ static Number fromComplex(Complex cpx);
+
+private:
+ int m_value;
+};
+
+LIBOTHER_API Point operator*(const Point &, const Number &);
+
+#endif // NUMBER_H