forked from Yasna1998/stackoverflow-in-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContent.h
More file actions
36 lines (33 loc) · 783 Bytes
/
Content.h
File metadata and controls
36 lines (33 loc) · 783 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
#include<iostream>
#include<vector>
#pragma once
enum ContentType{
QUESTION,
ANSWER
};
enum ContentRelationType{
DUPLICTE_OF,
ANSWER_TO
};
class Content;
class ContentRelation{
public:
ContentRelationType type;
Content* destination ;
Content* source ;
ContentRelation(Content* destination, Content* source , ContentRelationType type);
~ContentRelation();
};
class Content{
public:
std::string body;
ContentType type;
int visits;
std::vector<ContentRelation*> relations;
Content(std::string body, ContentType type);
~Content();
void add_relation(ContentRelationType type, Content &dest);
void edit_content(std::string body);
static std::vector<Content> search(std::string query);
void print_answers();
};