summaryrefslogtreecommitdiff
path: root/user.cpp
blob: ea2880b6afb7fca28abf012d7cc996677c46500a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "user.h"

namespace plexclient
{

user::user(std::istream *response)
{
	try {
		InputSource src(*response);
		DOMParser parser;
		Poco::XML::AutoPtr<Document> pDoc = parser.parse(&src);

		NodeIterator it(pDoc, Poco::XML::NodeFilter::SHOW_ALL);
		Node* pNode = it.nextNode();

		while(pNode) {
			if(Poco::icompare(pNode->nodeName(),"authentication-token") == 0) {
				pNode = it.nextNode();
				authenticationToken = pNode->nodeValue();
				break;
			}
			pNode = it.nextNode();
		}

	} catch(Exception &exc) {
		std::cerr << exc.displayText() << std::endl;
	}

}

}