-
Notifications
You must be signed in to change notification settings - Fork 2
/
News.h
49 lines (45 loc) · 1018 Bytes
/
News.h
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
#pragma once
#include <iostream>
#include "Admin.h"
#include <fstream>
#include <string>
#include <vector>
#include <assert.h>
#include "User.h"
#include <unordered_map>
using namespace std;
struct Details {
string Title;
string Writer;
string Discrepition;
string Date;
string string_rate;
string count;
string spam;
};
class News
{
string comment;
string userComment;
int count=0;
float Rate;
int total=0;
int type = 0 ;
int NumberOfRate =0;
int NumberOfSpam = 0;
public :
void ChangeSpam(string);
Details detail;
string string_type;
News(void);
vector<Details> ReadNews();
unordered_map<int, vector<Details>> ReadCatogNews();
bool ReadCertainNews(string);
void WriteNews(int , string[]);
void WriteComment(string);
float CalculateRate(string , float , string );
unordered_map<string , vector<string> > ReadComment();
//vector<string>ReadComment(string title);
int EndNumberOfNewsInCatogry(int);
void ChangeRate(string , float);
};