Advertisement
mrmamongo

header.hpp

Dec 11th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. // Copyright 2020 BoryaBes <[email protected]>
  2.  
  3. #ifndef INCLUDE_HEADER_HPP_
  4. #define INCLUDE_HEADER_HPP_
  5.  
  6. #include <any>
  7. #include <nlohmann/json.hpp>
  8. #include <string>
  9. #include <vector>
  10.  
  11. using nlohmann::json;
  12.  
  13. const int cname_column_width = 20;
  14. const int cgroup_column_width = 10;
  15. const int cavg_column_width = 6;
  16. const int cdebt_column_width = 10;
  17.  
  18. struct student_t {
  19.  private:
  20.   std::string name;
  21.   std::any group;
  22.   std::any avg;
  23.   std::any debt;
  24.   static student_t from_json(const json& j);
  25.  
  26.   friend void print(const student_t &student, std::ostream &os);
  27.   friend std::vector<student_t> parse_json(std::istream &json_stream);
  28.   friend std::ostream& operator<<(
  29.       std::ostream& os, const std::vector<student_t>& students);
  30. };
  31.  
  32. std::ostream& operator<<(
  33.     std::ostream& os, const std::vector<student_t>& students);
  34.  
  35. void print(const student_t &student, std::ostream &os);
  36. std::vector<student_t> parse_json(std::istream &json_stream);
  37.  
  38.  
  39. #endif  // INCLUDE_HEADER_HPP_
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement