#include <XspfWriter.h>
Public Member Functions | |
XspfWriter (XspfWriter const &source) | |
XspfWriter & | operator= (XspfWriter const &source) |
~XspfWriter () | |
bool | registerNamespace (XML_Char const *uri, XML_Char const *prefixSuggestion) |
bool | addTrack (XspfTrack const *track) |
bool | addTrack (XspfTrack const &track) |
bool | setProps (XspfProps const *props) |
bool | setProps (XspfProps const &props) |
int | writeFile (XML_Char const *filename) |
int | writeMemory (char *&memory, int &numBytes) |
void | reset (XspfXmlFormatter &formatter, XML_Char const *baseUri, bool embedBase=false) |
Static Public Member Functions | |
static XspfWriter * | makeWriter (XspfXmlFormatter &formatter, XML_Char const *baseUri, bool embedBase=false, int *errorCode=NULL) |
Static Public Attributes | |
static bool const | EMBED_AS_XML_BASE |
Base URI is embedded into the document. | |
static bool const | NO_XML_BASE |
Base URI is not embedded into the document. |
Definition at line 75 of file XspfWriter.h.
XspfWriter | ( | XspfWriter const & | source | ) |
Copy constructor.
source | Source to copy from |
~XspfWriter | ( | ) |
Frees all own memory.
bool addTrack | ( | XspfTrack const & | track | ) |
Appends a track to the playlist. The track
instance passed can be safely deleted after the call returns.
track | Track to append |
bool addTrack | ( | XspfTrack const * | track | ) |
Appends a track to the playlist. The track
instance passed can be safely deleted after the call returns.
track | Track to append |
static XspfWriter* makeWriter | ( | XspfXmlFormatter & | formatter, | |
XML_Char const * | baseUri, | |||
bool | embedBase = false , |
|||
int * | errorCode = NULL | |||
) | [static] |
Creates a new playlist writer.
formatter | XML formatter to use | |
baseUri | Absolute base URI to reduce against, pass NULL to keep all URIs absolute | |
embedBase | Embeds base URI as xml:base in root node if true or not if false | |
errorCode | Place to write error code or XSPF_WRITER_SUCCESS to. |
NULL
on error or a new'ed XspfWriter that you have to delete manually later. XspfWriter& operator= | ( | XspfWriter const & | source | ) |
Assignment operator.
source | Source to copy from |
bool registerNamespace | ( | XML_Char const * | uri, | |
XML_Char const * | prefixSuggestion | |||
) |
Pre-registers a namespace so it can still appear in the root element.
uri | Namespace URI | |
prefixSuggestion | Suggested prefix |
void reset | ( | XspfXmlFormatter & | formatter, | |
XML_Char const * | baseUri, | |||
bool | embedBase = false | |||
) |
Clears all previously added tracks and makes the writer reusable by another playlist.
formatter | XML formatter to use | |
baseUri | Absolute base URI to reduce against. | |
embedBase | Embeds base URI as xml:base in root node if true or not if false |
bool setProps | ( | XspfProps const & | props | ) |
Sets playlist-wide properties of the playlist to be written including the version of XSPF to be used. The props
instance passed can be safely deleted after the call returns.
props | Playlist properties to set, can be NULL |
bool setProps | ( | XspfProps const * | props | ) |
Sets playlist-wide properties of the playlist to be written including the version of XSPF to be used. The props
instance passed can be safely deleted after the call returns.
props | Playlist properties to set, can be NULL |
int writeFile | ( | XML_Char const * | filename | ) |
Finalizes the playlist and writes it to a file. You can call this method several times to write the same playlist to several files but you cannot add new tracks anymore. Call reset() to start over.
filename | Filename of the file to write to |
int writeMemory | ( | char *& | memory, | |
int & | numBytes | |||
) |
Finalizes the playlist and writes it to a block of memory. You can call this method several times to write the same playlist to several files but you cannot add new tracks anymore. Call reset() to start over.
memory | Reference to output memory block, delete[] on your own | |
numBytes | Size of the memory block in bytes |