diff options
author | chriszero <zerov83@gmail.com> | 2014-11-15 19:43:07 +0100 |
---|---|---|
committer | chriszero <zerov83@gmail.com> | 2014-11-15 19:43:07 +0100 |
commit | 23f9f7712bfa33b5a488a447a6fabe6035cc3240 (patch) | |
tree | 06bbe8e0bc52496c5ad3c41accc7524aa597e670 /user.cpp | |
parent | a40adaf76fb1267d38b4c5e6386933ddb2d0d328 (diff) | |
download | vdr-plugin-plex-23f9f7712bfa33b5a488a447a6fabe6035cc3240.tar.gz vdr-plugin-plex-23f9f7712bfa33b5a488a447a6fabe6035cc3240.tar.bz2 |
initial commit
Diffstat (limited to 'user.cpp')
-rw-r--r-- | user.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/user.cpp b/user.cpp new file mode 100644 index 0000000..ea2880b --- /dev/null +++ b/user.cpp @@ -0,0 +1,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; + } + +} + +} |