QtIotaBlock 0.4.1
Library with block types on IOTA
qbigint.hpp
1 #pragma once
2 
3 #include "arith_uint256.h"
4 #include <QDataStream>
5 #include <QString>
6 
7 namespace qiota
8 {
9 
10 template <unsigned int BITS> class qbase_uint : public base_uint<BITS>
11 {
13 
14  public:
15  QString toHex() const;
16  void fromHex(const QString &str);
17  qbase_uint(const QString str) : base_uint<BITS>()
18  {
19  this->fromHex(str);
20  }
21 
23  {
24  for (auto &v : obj.pn)
25  in >> v;
26  return in;
27  }
29  {
30  for (const auto &v : obj.pn)
31  out << v;
32  return out;
33  }
34 };
37 }; // namespace qiota
Definition: arith_uint256.h:24
uint32_t pn[WIDTH]
Definition: arith_uint256.h:28
Definition: qbigint.hpp:11
void fromHex(const QString &str)
Definition: qbigint.cpp:29
qbase_uint(const QString str)
Definition: qbigint.hpp:17
QString toHex() const
Definition: qbigint.cpp:7
friend QDataStream & operator>>(QDataStream &in, qbase_uint< BITS > &obj)
Definition: qbigint.hpp:22
friend QDataStream & operator<<(QDataStream &out, const qbase_uint< BITS > &obj)
Definition: qbigint.hpp:28
Definition: carray.hpp:22