-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmd.h
51 lines (39 loc) · 1 KB
/
admd.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
50
51
#ifndef ADMD_H
#define ADMD_H
#include <vector>
#include <string>
#include <fstream>
namespace admd {
class blog {
std::string s_title;
std::string s_data;
std::vector<std::string> s_images;
public:
std::string title() const;
std::string data() const;
std::vector<std::string> images() const;
};
blog parser(const std::string& filename);
bool bloggify(const std::string& filename);
}
std::string admd::blog::title() const {
return s_title;
}
std::string admd::blog::data() const {
return s_data;
}
std::vector<std::string> admd::blog::images() const {
return s_images;
}
admd::blog admd::parser(const std::string& filename) {
return admd::blog();
}
bool admd::bloggify(const std::string& filename) {
admd::blog blog = admd::parser(filename);
std::ofstream outfile;
outfile.open(blog.title() + ".html", std::ios::out | std::ios::trunc);
outfile << blog.data();
outfile.close();
return true;
}
#endif //ADMD_H