-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotes.cpp
63 lines (48 loc) · 1.03 KB
/
Notes.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
#include "Notes.h"
#include <string>
#include <vector>
Notes::Notes() {
}
Notes Notes::load(std::istream & file) {
Notes R;
std::string fileLine;
std::string Numbers = "0123456789";
int i = 0;
while (!file.eof())
{
getline(file, fileLine);
if (fileLine.find("Title:") < fileLine.length())
{
fileLine = fileLine.substr(6);
R.m_title = fileLine;
}
else if (fileLine.find("Content:") < fileLine.length())
{
fileLine = fileLine.substr(8);
R.m_content = fileLine;
}
else if (fileLine.find("Topic:") < fileLine.length()) {
fileLine = fileLine.substr(6);
R.m_topic = fileLine;
}
}
return R;
}
std::string Notes::get_content() {
return m_content;
}
std::string Notes::get_documentType() {
return "Notes";
}
std::string Notes::get_otherStringInformation(){
return get_topic();
}
int Notes::get_otherIntInformation(){
return -1;
}
std::string Notes::get_title() {
return m_title;
}
std::string Notes::get_topic() {
return m_topic;
}