XspfWriter Class Reference

#include <XspfWriter.h>

List of all members.

Public Member Functions

 XspfWriter (XspfWriter const &source)
XspfWriteroperator= (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 XspfWritermakeWriter (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.


Detailed Description

Writes a playlist as XSPF to a file. XSPF version 0 and 1 are supported.

Definition at line 75 of file XspfWriter.h.


Constructor & Destructor Documentation

XspfWriter ( XspfWriter const &  source  ) 

Copy constructor.

Parameters:
source Source to copy from

~XspfWriter (  ) 

Frees all own memory.


Member Function Documentation

bool addTrack ( XspfTrack const &  track  ) 

Appends a track to the playlist. The track instance passed can be safely deleted after the call returns.

Parameters:
track Track to append
Returns:
Success flag
Since:
1.0.0

bool addTrack ( XspfTrack const *  track  ) 

Appends a track to the playlist. The track instance passed can be safely deleted after the call returns.

Parameters:
track Track to append
Returns:
Success flag
Since:
1.0.0

static XspfWriter* makeWriter ( XspfXmlFormatter formatter,
XML_Char const *  baseUri,
bool  embedBase = false,
int *  errorCode = NULL 
) [static]

Creates a new playlist writer.

Parameters:
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.
Returns:
NULL on error or a new'ed XspfWriter that you have to delete manually later.
Since:
1.0.0

XspfWriter& operator= ( XspfWriter const &  source  ) 

Assignment operator.

Parameters:
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.

Attention:
registerNamespace() must be called before any calls to setProps() or addTrack().
Parameters:
uri Namespace URI
prefixSuggestion Suggested prefix
Returns:
Success flag

void reset ( XspfXmlFormatter formatter,
XML_Char const *  baseUri,
bool  embedBase = false 
)

Clears all previously added tracks and makes the writer reusable by another playlist.

Parameters:
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
Since:
1.0.0

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.

Attention:
setProps() must be called before any calls to addTrack().
Parameters:
props Playlist properties to set, can be NULL
Returns:
Success flag
Since:
1.0.0

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.

Attention:
setProps() must be called before any calls to addTrack().
Parameters:
props Playlist properties to set, can be NULL
Returns:
Success flag
Since:
1.0.0

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.

Parameters:
filename Filename of the file to write to
Returns:
Error code

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.

Parameters:
memory Reference to output memory block, delete[] on your own
numBytes Size of the memory block in bytes
Returns:
Error code


The documentation for this class was generated from the following file:

Generated on Sat Mar 7 01:09:37 2009 for libxspf by  doxygen 1.5.8