-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbook.h
More file actions
69 lines (62 loc) · 1.6 KB
/
Copy pathbook.h
File metadata and controls
69 lines (62 loc) · 1.6 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef BOOK_H
#define BOOK_H
#include<QString>
#include<QJsonArray>
#include<QJsonObject>
class book{
protected:
QString _id;
QString _name;
QString _author;
QString _pub_year;
QString _issued_by="NULL";
QString _issued_date="NULL";
public:
QString id(){
return _id;
}
QString name(){
return _name;
}
QString author(){
return _author;
}
QString pub_year(){
return _pub_year;
}
QString issued_by(){
return _issued_by;
}
QString issued_date(){
return _issued_date;
}
void new_id(QString new_id){
_id=new_id;
}
void new_name(QString new_name){
_name=new_name;
}
void new_author(QString new_author){
_author=new_author;
}
void new_pub_year(QString new_pub_year){
_pub_year=new_pub_year;
}
void new_issued_by(QString new_issued_by){
_issued_by=new_issued_by;
}
void new_issued_date(QString new_issued_date){
_issued_date=new_issued_date;
}
QJsonObject book_to_qjsonobj(){
QJsonObject Jtemp;
Jtemp.insert("id",_id);
Jtemp.insert("name",_name);
Jtemp.insert("author",_author);
Jtemp.insert("pub_year",_pub_year);
Jtemp.insert("issued_by",_issued_by);
Jtemp.insert("issued_date",_issued_date);
return Jtemp;
}
};
#endif // BOOK_H