add pugixml

This commit is contained in:
Jacek Jendrzej
2015-04-27 22:26:45 +02:00
parent 497f05b730
commit 422c91d117
16 changed files with 236 additions and 111 deletions

View File

@@ -1114,7 +1114,7 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *nametag,
if (answer_parser != NULL) {
xmlNodePtr element = xmlDocGetRootElement(answer_parser);
element = element->xmlChildrenNode;
element = xmlChildrenNode(element);
xmlNodePtr element_tmp = element;
if (element == NULL) {
printf("[openFilebrowser] No valid XML File.\n");
@@ -1124,7 +1124,7 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *nametag,
// count # of entries
while (element) {
maxProgress++;
element = element->xmlNextNode;
element = xmlNextNode(element);
}
element = element_tmp;
long listPos = -1;
@@ -1150,7 +1150,7 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *nametag,
if (usechild) {
const char *type = NULL;
xmlNodePtr child = element->xmlChildrenNode;
xmlNodePtr child = xmlChildrenNode(element);
while (child) {
if (strcmp(xmlGetName(child), nametag) == 0)
name = xmlGetData(child);
@@ -1163,7 +1163,7 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *nametag,
if (ptr)
bitrate = atoi(ptr);
}
child = child->xmlNextNode;
child = xmlNextNode(child);
}
if(type){
if (strcmp("audio/mpeg", type) == 0) skip = false;
@@ -1190,7 +1190,7 @@ void CAudioPlayerGui::scanXmlData(xmlDocPtr answer_parser, const char *nametag,
else
addUrl2Playlist(url, name, bitrate);
}
element = element->xmlNextNode;
element = xmlNextNode(element);
g_RCInput->getMsg(&msg, &data, 0);
}

View File

@@ -448,7 +448,7 @@ printf("CFileBrowser::readDir_sc: read done, size %d\n", (int)answer.size());
xml_decode = 1;
else if (strcmp(xmlGetName(element), "stationlist") == 0)
xml_decode = 2;
element = element->xmlChildrenNode;
element = xmlChildrenNode(element);
if (element == NULL) {
printf("[FileBrowser] SC: Directory cannot be read.\n");
@@ -523,7 +523,7 @@ printf("CFileBrowser::readDir_sc: read done, size %d\n", (int)answer.size());
}
}
}
element = element->xmlNextNode;
element = xmlNextNode(element);
}
}
xmlFreeDoc(answer_parser);

View File

@@ -139,7 +139,8 @@ CMenuOptionStringChooser* COsdLangSetup::getTzItems()
{
tzSelect = new CMenuOptionStringChooser(LOCALE_MAINSETTINGS_TIMEZONE, &g_settings.timezone, true, tzNotifier, CRCInput::RC_green, NULL, true);
tzSelect->setHint("", LOCALE_MENU_HINT_TIMEZONE);
xmlNodePtr search = xmlDocGetRootElement(parser)->xmlChildrenNode;
xmlNodePtr search = xmlDocGetRootElement(parser);
search = xmlChildrenNode(search);
bool found = false;
while (search)
@@ -163,7 +164,7 @@ CMenuOptionStringChooser* COsdLangSetup::getTzItems()
}
}
}
search = search->xmlNextNode;
search = xmlNextNode(search);
}
if (!found)

View File

@@ -250,7 +250,7 @@ std::vector<UPnPEntry> *CUpnpBrowserGui::decodeResult(std::string result)
}
entries = new std::vector<UPnPEntry>;
for (node=root->xmlChildrenNode; node; node=node->xmlNextNode)
for (node=xmlChildrenNode(root); node; node=xmlNextNode(node))
{
bool isdir;
std::string title, artist = "", album = "", albumArtURI = "", id, children;
@@ -260,7 +260,7 @@ std::vector<UPnPEntry> *CUpnpBrowserGui::decodeResult(std::string result)
{
std::vector<UPnPResource> resources;
isdir=true;
for (snode=node->xmlChildrenNode; snode; snode=snode->xmlNextNode)
for (snode=xmlChildrenNode(node); snode; snode=xmlNextNode(snode))
{
type=xmlGetName(snode);
p = strchr(type,':');
@@ -294,7 +294,7 @@ std::vector<UPnPEntry> *CUpnpBrowserGui::decodeResult(std::string result)
std::string protocol, prot, network, mime, additional;
CFile::FileType ftype = CFile::FILE_UNKNOWN;
isdir=false;
for (snode=node->xmlChildrenNode; snode; snode=snode->xmlNextNode)
for (snode=xmlChildrenNode(node); snode; snode=xmlNextNode(snode))
{
std::string duration, url, size;
unsigned int i;