00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00046 #ifndef XSPF_DATA_H
00047 #define XSPF_DATA_H
00048
00049 #include "XspfDefines.h"
00050 #include <deque>
00051
00052 namespace Xspf {
00053
00054
00055 class XspfExtension;
00056 class XspfDataPrivate;
00057
00058
00062 class XspfData {
00063
00064 friend class XspfDataPrivate;
00065
00066 private:
00068 XspfDataPrivate * const d;
00069
00070
00071 protected:
00075 XspfData();
00076
00082 XspfData(XspfData const & source);
00083
00089 XspfData & operator=(XspfData const & source);
00090
00095 virtual ~XspfData();
00096
00097 public:
00107 void giveImage(XML_Char const * image, bool copy);
00108
00118 void giveInfo(XML_Char const * info, bool copy);
00119
00129 void giveAnnotation(XML_Char const * annotation, bool copy);
00130
00140 void giveCreator(XML_Char const * creator, bool copy);
00141
00151 void giveTitle(XML_Char const * title, bool copy);
00152
00161 void giveAppendLink(XML_Char const * rel, bool copyRel, XML_Char const * content, bool copyContent);
00162
00171 void giveAppendMeta(XML_Char const * rel, bool copyRel, XML_Char const * content, bool copyContent);
00172
00179 void giveAppendExtension(XspfExtension const * extension, bool copy);
00180
00188 void lendImage(XML_Char const * image);
00189
00197 void lendInfo(XML_Char const * info);
00198
00206 void lendAnnotation(XML_Char const * annotation);
00207
00215 void lendCreator(XML_Char const * creator);
00216
00224 void lendTitle(XML_Char const * title);
00225
00234 void lendAppendLink(XML_Char const * rel, XML_Char const * content);
00235
00244 void lendAppendMeta(XML_Char const * rel, XML_Char const * content);
00245
00253 void lendAppendExtension(XspfExtension * extension);
00254
00260 XML_Char * stealImage();
00261
00267 XML_Char * stealInfo();
00268
00274 XML_Char * stealAnnotation();
00275
00281 XML_Char * stealCreator();
00282
00288 XML_Char * stealTitle();
00289
00298 std::pair<XML_Char *, XML_Char *> * stealFirstLink();
00299
00308 std::pair<XML_Char *, XML_Char *> * stealFirstMeta();
00309
00318 XspfExtension * stealFirstExtension();
00319
00325 XML_Char const * getImage() const;
00326
00332 XML_Char const * getInfo() const;
00333
00339 XML_Char const * getAnnotation() const;
00340
00346 XML_Char const * getCreator() const;
00347
00353 XML_Char const * getTitle() const;
00354
00363 std::pair<XML_Char const *, XML_Char const *> * getLink(int index) const;
00364
00373 std::pair<XML_Char const *, XML_Char const *> * getMeta(int index) const;
00374
00383 XspfExtension const * getExtension(int index) const;
00384
00390 int getLinkCount() const;
00391
00397 int getMetaCount() const;
00398
00404 int getExtensionCount() const;
00405
00406 private:
00416 static void appendHelper(std::deque<std::pair<
00417 std::pair<XML_Char const *, bool> *,
00418 std::pair<XML_Char const *, bool> *> *> * & container,
00419 XML_Char const * rel,
00420 bool ownRel,
00421 XML_Char const * content,
00422 bool ownContent);
00423
00431 static void appendHelper(std::deque<
00432 std::pair<XspfExtension const *, bool> *> * & container,
00433 XspfExtension const * extenstion,
00434 bool own);
00435
00436 protected:
00446 static XML_Char * stealHelper(XML_Char const * & property, bool own);
00447
00448 private:
00455 static std::pair<XML_Char *, XML_Char *> * stealFirstHelper(
00456 std::deque<std::pair<std::pair<XML_Char const *, bool> *,
00457 std::pair<XML_Char const *, bool> *> *> * & container);
00458
00465 static XspfExtension * stealFirstHelper(std::deque<
00466 std::pair<XspfExtension const *, bool> *> * & container);
00467
00478 static std::pair<XML_Char const *, XML_Char const *> * getHelper(
00479 std::deque<std::pair<std::pair<XML_Char const *, bool> *,
00480 std::pair<XML_Char const *, bool> *> *> * & container,
00481 int index);
00482
00493 static XspfExtension const * getHelper(
00494 std::deque<std::pair<XspfExtension const *, bool> *> * & container,
00495 int index);
00496
00497 protected:
00499 void virtualHook(int methodId, void * parameters);
00501
00502 public:
00503 static bool const COPY;
00504 static bool const TRANSFER;
00505
00506 };
00507
00508
00509 }
00510
00511 #endif // XSPF_DATA_H