blob: 14c5227f6ef06574ba6169b86cb505b267c02464 (
plain)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
/**
* @file main.cpp
* @brief Entry point
* @author manzerbredes
* @version Prototype
* @date 8 Mars 2015
*
* Entry point of the application.
*
*/
//----- std -----
#include <iostream>
#include <string>
#include <vector>
//----- class -----
#include "FileManIOFile.hpp"
#include "FileManParser.hpp"
#include "Website.hpp"
#include <list>
#include <cstdlib>
#include <libxml++/nodes/node.h>
#include <libxml++/libxml++.h>
/**
* @fn int main(int argc, char *argv[])
* @author manzerbredes
* @brief main function
* @param argc contain *argv[] length
* @param *argv[] contain the arguments list
* @return Return code, an int.
*/
int main(int argc, char *argv[]){
/*
FileManIOFile fichier("Doxygen/bob.bin");
fichier.read("loic");
std::cout << fichier.getData();*/
std::stringstream xml;
xml <<"<?xml version=\"1.0\" standalone=\"yes\" ?>\n\
<forgetIt> \n\
<websites> \n\
\n\
</websites> \n\
</forgetIt> \n\
";
/*FileManParser parser(xml);
std::vector<Website> websites= parser.getContainer();
std::cout << typeid(websites.at(0)).name();*/
/*xmlpp::DomParser parser;
parser.parse_file("Doxygen/doc.xml");
xmlpp::Document* doc=parser.get_document();
const xmlpp::Node* pNode = doc->get_root_node(); //deleted by DomParser.
const Glib::ustring nom="news";
const Glib::ustring nm="";
xmlpp::Element* elem=(xmlpp::Element*)pNode;*/
//std::vector<xmlpp::Node*> websites=pNode->find("//websites/*/attribute::id");
/*
xmlpp::Element* ell=(xmlpp::Element*)websites.at(0);
ell->set_child_text("56");
elem->add_child(nom);
std::cout << doc->write_to_string();*/
//std::cout << (elem->get_child_text())->get_content();
FileManParser fichier("loic");
std::vector<Website> *bb=fichier.getWebsites();
Website a;
a.setTitle("pierre");
bb->push_back(a);
fichier.updateParser();
std::cout << fichier.getDocument();
return 0;
}
|