2 * Copyright (C) 2012-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.
14 #define MAX_SCRAPER_BUFFERS 20
24 class CScraperSettings
;
30 CScraperParser(const CScraperParser
& parser
);
32 CScraperParser
& operator= (const CScraperParser
& parser
);
33 bool Load(const std::string
& strXMLFile
);
34 bool IsNoop() const { return m_isNoop
; }
37 const std::string
& GetFilename() const { return m_strFile
; }
38 std::string
GetSearchStringEncoding() const
39 { return m_SearchStringEncoding
; }
40 const std::string
Parse(const std::string
& strTag
,
41 ADDON::CScraper
* scraper
);
43 void AddDocument(const CXBMCTinyXML
* doc
);
45 std::string m_param
[MAX_SCRAPER_BUFFERS
];
49 void ReplaceBuffers(std::string
& strDest
);
50 void ParseExpression(const std::string
& input
, std::string
& dest
, TiXmlElement
* element
, bool bAppend
);
52 /*! \brief Parse an 'XSLT' declaration from the scraper
53 This allow us to transform an inbound XML document using XSLT
54 to a different type of XML document, ready to be output direct
55 to the album loaders or similar
56 \param input the input document
57 \param dest the output destination for the conversion
58 \param element the current XML element
59 \param bAppend append or clear the buffer
61 void ParseXSLT(const std::string
& input
, std::string
& dest
, TiXmlElement
* element
, bool bAppend
);
62 void ParseNext(TiXmlElement
* element
);
63 void Clean(std::string
& strDirty
);
64 void ConvertJSON(std::string
&string
);
66 void GetBufferParams(bool* result
, const char* attribute
, bool defvalue
);
67 void InsertToken(std::string
& strOutput
, int buf
, const char* token
);
69 CXBMCTinyXML
* m_document
;
70 TiXmlElement
* m_pRootElement
;
72 const char* m_SearchStringEncoding
;
75 std::string m_strFile
;
76 ADDON::CScraper
* m_scraper
;