1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #include <anna/core/tracing/Logger.hpp>
10 #include <anna/core/tracing/TraceMethod.hpp>
11 #include <anna/config/defines.hpp>
12 #include <anna/core/functions.hpp>
14 #include <anna/io/functions.hpp>
16 #include <libxml/HTMLparser.h>
18 #include <anna/html/DocumentFile.hpp>
23 _xmlDoc* html::DocumentFile::do_initialize(const char* filename)
24 throw(RuntimeException) {
25 LOGMETHOD(TraceMethod tf("anna::html::DocumentFile", "do_initialize", ANNA_FILE_LOCATION));
26 _xmlDoc* result = NULL;
27 a_filename = filename;
29 string msg("html::DocumentFile::do_initialize | Filename: ");
31 Logger::debug(msg, ANNA_FILE_LOCATION);
34 if(io::functions::exists(filename) == false) {
35 string msg("html::DocumentFile::do_initialize | File: ");
37 msg += " | Not found";
38 throw RuntimeException(msg, ANNA_FILE_LOCATION);
41 result = htmlParseFile(filename, NULL);
44 throw RuntimeException(functions::asString("Error analyzing HTML document: %s", filename), ANNA_FILE_LOCATION);
49 _xmlDoc* html::DocumentFile::do_initialize(const anna::DataBlock&)
50 throw(RuntimeException) {
51 throw RuntimeException("html::DocumentFile::do_initialize | Not implemented", ANNA_FILE_LOCATION);