-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyJsonFilms.h
More file actions
48 lines (47 loc) · 850 Bytes
/
myJsonFilms.h
File metadata and controls
48 lines (47 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// Created by Sg on 03.09.2022.
//
#pragma once
#include <fstream>
#include <map>
#include <iostream>
#include <string>
#include <nlohmann/json.hpp>
namespace nh = nlohmann;
using namespace std;
enum filmInfo
{
NAME,
COUNTRY,
DATE,
PRODUCED,
PRODUCTION,
DIRECTED,
SCREENPLAY
};
enum commands
{
FROMTXT = 1,
FROMJSON,
WRITEJSON,
SEARCH,
SHOWALLINFO,
SHOWFILMINFO,
EXIT
};
struct Character
{
std::string character = "None";
std::string actor = "None";
};
struct Film
{
string info[7];
std::vector<Character> Characters;
};
pair<string, Film> filmFromTxt(ifstream& file);
void from_json(const nh::json& j,Character& val);
void to_json(nh::json& j, const Character& val);
void from_json(const nh::json& j, Film& val);
void to_json(nh::json& j, const Film& val);
void showMenu();