#include <XspfWriter.h>
|
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.
|
|
Writes a playlist as XSPF to a file. XSPF version 0 and 1 are supported.
Definition at line 75 of file XspfWriter.h.
◆ XspfWriter()
Copy constructor.
- Parameters
-
source | Source to copy from |
◆ ~XspfWriter()
◆ addTrack() [1/2]
Appends a track to the playlist. The track
instance passed can be safely deleted after the call returns.
- Parameters
-
- Returns
- Success flag
- Since
- 1.0.0
◆ addTrack() [2/2]
Appends a track to the playlist. The track
instance passed can be safely deleted after the call returns.
- Parameters
-
- Returns
- Success flag
- Since
- 1.0.0
◆ makeWriter()
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
◆ operator=()
Assignment operator.
- Parameters
-
source | Source to copy from |
◆ registerNamespace()
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
◆ reset()
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
◆ setProps() [1/2]
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
◆ setProps() [2/2]
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
◆ writeFile()
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
◆ writeMemory()
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: