2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 // NfoFile.h: interface for the CNfoFile class.
13 //////////////////////////////////////////////////////////////////////
15 #include "InfoScanner.h"
16 #include "addons/Scraper.h"
17 #include "utils/XBMCTinyXML.h"
31 virtual ~CNfoFile() { Close(); }
33 CInfoScanner::INFO_TYPE
Create(const std::string
&,
34 const ADDON::ScraperPtr
&, int episode
=-1);
36 bool GetDetails(T
& details
, const char* document
=NULL
,
37 bool prioritise
=false)
41 doc
.Parse(document
, TIXML_ENCODING_UNKNOWN
);
42 else if (m_headPos
< m_doc
.size())
43 doc
.Parse(m_doc
.substr(m_headPos
), TIXML_ENCODING_UNKNOWN
);
47 return details
.Load(doc
.RootElement(), true, prioritise
);
51 void SetScraperInfo(ADDON::ScraperPtr info
) { m_info
= std::move(info
); }
52 ADDON::ScraperPtr
GetScraperInfo() { return m_info
; }
53 const CScraperUrl
&ScraperUrl() const { return m_scurl
; }
55 static int Scrape(ADDON::ScraperPtr
& scraper
, CScraperUrl
& url
,
56 const std::string
& content
);
58 static std::vector
<ADDON::ScraperPtr
> GetScrapers(ADDON::AddonType type
,
59 const ADDON::ScraperPtr
& selectedScraper
);
64 ADDON::ScraperPtr m_info
;
65 ADDON::AddonType m_type
{};
68 int Load(const std::string
&);