print_helpers.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef __PRINT_HELPERS_HPP
  2. #define __PRINT_HELPERS_HPP
  3. #include <iomanip>
  4. #include <istream>
  5. #include <ostream>
  6. #include <cstring>
  7. extern "C" {
  8. #include "fp12e.h"
  9. #include "fp6e.h"
  10. #include "fp2e.h"
  11. #include "fpe.h"
  12. }
  13. class Fp12e {
  14. public:
  15. Fp12e();
  16. Fp12e(const fp12e_t& input);
  17. friend std::ostream& operator<<(std::ostream& os, const Fp12e& output);
  18. friend std::istream& operator>>(std::istream& is, Fp12e& input);
  19. fp12e_t data;
  20. };
  21. class Fp6e {
  22. public:
  23. Fp6e();
  24. Fp6e(const fp6e_t& input);
  25. friend std::ostream& operator<<(std::ostream& os, const Fp6e& output);
  26. friend std::istream& operator>>(std::istream& is, Fp6e& input);
  27. fp6e_t data;
  28. };
  29. class Fp2e {
  30. public:
  31. Fp2e();
  32. Fp2e(const fp2e_t& input);
  33. friend std::ostream& operator<<(std::ostream& os, const Fp2e& output);
  34. friend std::istream& operator>>(std::istream& is, Fp2e& input);
  35. fp2e_t data;
  36. };
  37. class Fpe {
  38. public:
  39. Fpe();
  40. Fpe(const fpe_t& input);
  41. friend std::ostream& operator<<(std::ostream& os, const Fpe& output);
  42. friend std::istream& operator>>(std::istream& is, Fpe& input);
  43. fpe_t data;
  44. };
  45. std::ostream& hex_double(std::ostream& os, double d);
  46. std::istream& hex_double(std::istream& is, double& d);
  47. #endif