forgetIt/main.cpp

110 lines
2 KiB
C++
Raw Normal View History

/**
* @file main.cpp
* @brief Entry point
* @author manzerbredes
* @version Prototype
* @date 8 Mars 2015
*
* Entry point of the application.
*
*/
//----- std -----
2015-03-06 11:06:27 +04:00
#include <iostream>
#include <string>
2015-03-11 19:53:47 +04:00
#include <vector>
2015-03-06 11:06:27 +04:00
//----- class -----
#include "FileManIOFile.hpp"
2015-03-11 16:12:56 +04:00
#include "FileManParser.hpp"
2015-03-11 19:53:47 +04:00
#include "Website.hpp"
2015-03-06 11:06:27 +04:00
2015-03-14 18:44:05 +04:00
#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[]){
2015-03-06 11:06:27 +04:00
2015-03-13 15:39:56 +04:00
/*
FileManIOFile fichier("Doxygen/bob.bin");
2015-03-11 16:12:56 +04:00
2015-03-13 15:39:56 +04:00
fichier.read("loic");
std::cout << fichier.getData();*/
2015-03-11 16:12:56 +04:00
2015-03-14 18:44:05 +04:00
std::stringstream xml;
xml <<"<?xml version=\"1.0\" standalone=\"yes\" ?>\n\
2015-03-11 16:12:56 +04:00
<forgetIt> \n\
<websites> \n\
\n\
</websites> \n\
</forgetIt> \n\
";
2015-03-14 18:44:05 +04:00
/*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();
2015-03-11 16:12:56 +04:00
2015-03-14 18:44:05 +04:00
Website a;
a.setTitle("pierre");
bb->push_back(a);
fichier.updateParser();
std::cout << fichier.getDocument();
2015-03-06 11:06:27 +04:00
return 0;
}
2015-03-14 18:44:05 +04:00