Syndication Library
feed.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "feed.h"
00024 #include "category.h"
00025 #include "image.h"
00026 #include "item.h"
00027 #include "person.h"
00028
00029 #include <QtCore/QList>
00030 #include <QtCore/QString>
00031
00032 namespace Syndication {
00033
00034 Feed::~Feed()
00035 {
00036 }
00037
00038 QString Feed::debugInfo() const
00039 {
00040 QString info;
00041
00042 info += "# Feed begin ######################\n";
00043
00044 QString dtitle = title();
00045 if (!dtitle.isNull())
00046 info += "title: #" + dtitle + "#\n";
00047
00048 QString dlink = link();
00049 if (!dlink.isNull())
00050 info += "link: #" + dlink + "#\n";
00051
00052 QString ddescription = description();
00053 if (!ddescription.isNull())
00054 info += "description: #" + ddescription + "#\n";
00055
00056 QString dcopyright = copyright();
00057 if (!dcopyright.isNull())
00058 info += "copyright: #" + dcopyright + "#\n";
00059
00060 QString dlanguage = language();
00061 if (!dlanguage.isNull())
00062 info += "language: #" + dlanguage + "#\n";
00063
00064 QList<PersonPtr> dauthors = authors();
00065 QList<PersonPtr>::ConstIterator itp = dauthors.begin();
00066 QList<PersonPtr>::ConstIterator endp = dauthors.end();
00067
00068 for ( ; itp != endp; ++itp)
00069 info += (*itp)->debugInfo();
00070
00071 QList<CategoryPtr> dcategories = categories();
00072 QList<CategoryPtr>::ConstIterator itc = dcategories.begin();
00073 QList<CategoryPtr>::ConstIterator endc = dcategories.end();
00074
00075 for ( ; itc != endc; ++itc)
00076 info += (*itc)->debugInfo();
00077
00078 ImagePtr dimage = image();
00079
00080 if (!dimage->isNull())
00081 info += dimage->debugInfo();
00082
00083 QList<ItemPtr> ditems = items();
00084 QList<ItemPtr>::ConstIterator it = ditems.begin();
00085 QList<ItemPtr>::ConstIterator end = ditems.end();
00086
00087 for ( ; it != end; ++it)
00088 info += (*it)->debugInfo();
00089
00090 info += "# Feed end ########################\n";
00091
00092 return info;
00093 }
00094
00095 }