-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwiki_graph.cpp
69 lines (56 loc) · 1.2 KB
/
wiki_graph.cpp
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
#include "wiki_graph.hpp"
WikiGraph::~WikiGraph(){
if (n_links > 0){
delete[] titles;
delete[] sizes;
delete[] links;
delete[] redirect;
delete[] offset;
}
}
void WikiGraph::load_from_stream(std::istream &file)
{
n_pages = n_links = 0; //FIXIT: прочитать из файла
titles = new std::string [n_pages];
sizes = new int32_t [n_pages];
links = new int32_t [n_links];
redirect = new int32_t [n_pages];
offset = new int32_t [n_pages + 1];
//FIXIT прочитать граф из файла
std::cout << utf16_to_utf8(L"Граф загружен") << std::endl;
}
int32_t WikiGraph::get_number_of_links_from(int32_t id)
{
//FIXIT
return 0;
};
int32_t* WikiGraph::get_links_from(int32_t id)
{
//FIXIT
return links;
};
int32_t WikiGraph::get_id(std::string title)
{
//FIXIT
return 0;
};
int32_t WikiGraph::get_number_of_pages()
{
//FIXIT
return 0;
};
bool WikiGraph::is_redirect(int32_t id)
{
//FIXIT
return true;
};
std::string WikiGraph::get_title(int32_t id)
{
//FIXIT
return "";
};
int32_t WikiGraph::get_page_size(int32_t id)
{
//FIXIT
return 0;
};