AtomParse.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef NULLSOFT_ATOMPARSEH
  2. #define NULLSOFT_ATOMPARSEH
  3. #if 0
  4. #include "RFCDate.h"
  5. #include "XMLNode.h"
  6. #include "Feeds.h"
  7. #include "../nu/AutoChar.h"
  8. #include "ChannelSync.h"
  9. void ReadAtomItem(XMLNode *item, Channel &channel)
  10. {
  11. }
  12. void ReadAtomChannel(XMLNode *node, Channel &newChannel)
  13. {
  14. XMLNode *curNode = 0;
  15. curNode = node->Get(L"title");
  16. if (curNode)
  17. newChanneltitle = curNode->content;
  18. curNode = node->Get(L"subtitle");
  19. if (curNode)
  20. newChannel.description = curNode->content;
  21. XMLNode::NodeList &links = node->GetList(L"link");
  22. XMLNode::NodeList::iterator linkItr;
  23. for (linkItr=links.begin();linkItr!=links.end();linkItr++)
  24. {
  25. if ((*linkItr)->properties[L"rel"].empty()
  26. || (*linkItr)->properties[L"rel"]== L"alternate")
  27. newChannel.link = (*linkItr)->properties[L"href"];
  28. }
  29. XMLNode::NodeList &entries = node->GetList(L"entry");
  30. XMLNode::NodeList::iterator entryItr;
  31. for (entryItr=entries.begin();entryItr!=entries.end();entryItr++)
  32. {
  33. }
  34. }
  35. void ReadAtom(XMLNode *atom, ChannelSync *sync)
  36. {
  37. sync->BeginChannelSync();
  38. Channel newChannel;
  39. ReadAtomChannel(atom, newChannel);
  40. sync->NewChannel(newChannel);
  41. sync->EndChannelSync();
  42. }
  43. #endif
  44. #endif