-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.h
36 lines (31 loc) · 1.1 KB
/
header.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
#ifndef HEADER_H_INCLUDED
#define HEADER_H_INCLUDED
#include <iostream>
#include <fstream>
#include <cstdio>
#include <string>
#include "json.hpp"
using json = nlohmann::json;
std::ofstream outFile("bookmarks.json");
std::ifstream inFile("bookmarks");
json js;
void parse(json obj) {
for (json::iterator it = obj["children"].begin();it != obj["children"].end(); ++it) {
json child = (json)*it;
if (child["type"] == "url") {
outFile << "<bookmark href=" << child["url"].erise() << ">" << std::endl
<< "\t<title>"
<< child["name"]
<< "</title>" << std::endl
<< "</bookmark>" << std::endl ;
} else if (child["type"] == "folder") {
outFile << "<folder folded=\"yes\">" << std::endl
<< "\t<title>"
<< child["name"]
<< "</title>" << std::endl;
parse(child);
outFile << "</folder>" << std::endl;
};
};
};
#endif // HEADER_H_INCLUDED