-
Notifications
You must be signed in to change notification settings - Fork 2
/
SaveTextExport.cpp
85 lines (69 loc) · 2.14 KB
/
SaveTextExport.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "SaveTextExport.h"
#include "Note.h"
#include "Article.h"
#include "ImageNote.h"
#include "AudioNote.h"
#include "VideoNote.h"
#include "Document.h"
#include "TagManager.h"
//SaveTextExport
QString SaveTextExport::header() const
{
return "";
}
QString SaveTextExport::footer() const
{
return "";
}
QString SaveTextExport::exportNote(const Article *note, unsigned int level) const
{
QString str;
str += note->getFilePath()+"\n"+note->getTitle()+"\n";
str += TagsToString(note->getTags()) + "\n";
str += note->isDeleted() ? "isDeleted\n" : "notDeleted\n";
str += note->getText()+"\n";
return str;
}
QString SaveTextExport::exportNote(const ImageNote *note, unsigned int level) const
{
QString str;
str += note->getFilePath()+"\n"+note->getTitle()+"\n";
str += TagsToString(note->getTags()) + "\n";
str += note->isDeleted() ? "isDeleted\n" : "notDeleted\n";
str += note->getDescription()+"\n";
str += note->getMediaPath()+"\n";
return str;
}
QString SaveTextExport::exportNote(const Document *doc, unsigned int level) const
{
QString str;
str+=doc->getFilePath()+"\n";
str+=doc->getTitle()+"\n";
str+= TagsToString(doc->getTags()) + "\n";
str+= doc->isDeleted() ? "isDeleted\n" : "notDeleted\n";
for(QList<Note *>::const_iterator it = doc->begin(); it!=doc->end(); it++)
{
str+=(*it)->getFilePath()+"\n";
}
return str;
}
QString SaveTextExport::exportNote(const AudioNote *note, unsigned int level) const
{
QString str;
str += note->getFilePath()+"\n"+note->getTitle()+"\n";
str += TagsToString(note->getTags()) + "\n";
str += note->isDeleted() ? "isDeleted\n" : "notDeleted\n";
str += note->getDescription()+"\n";
str += note->getMediaPath()+"\n";
return str;
}
QString SaveTextExport::exportNote(const VideoNote *note, unsigned int level) const
{
QString str;
str += note->getFilePath()+"\n"+note->getTitle()+"\n";
str += TagsToString(note->getTags()) + "\n";
str += note->isDeleted() ? "isDeleted\n" : "notDeleted\n";
str += note->getDescription()+"\n";
str += note->getMediaPath()+"\n";
return str;
}