libsidplayfp
2.0.2
|
#include <stil.h>
Public Types | |
enum | STILField { all, name, author, title, artist, comment } |
Enum to use for asking for specific fields. | |
enum | STILerror { NO_STIL_ERROR = 0, BUG_OPEN, WRONG_DIR, NOT_IN_STIL, NOT_IN_BUG, WRONG_ENTRY, CRITICAL_STIL_ERROR = 10, BASE_DIR_LENGTH, STIL_OPEN, NO_EOL, NO_STIL_DIRS, NO_BUG_DIRS } |
Enum that describes the possible errors this class may encounter. More... | |
Public Member Functions | |
STIL (const char *stilPath=DEFAULT_PATH_TO_STIL, const char *bugsPath=DEFAULT_PATH_TO_BUGLIST) | |
const char * | getVersion () |
float | getVersionNo () |
bool | setBaseDir (const char *pathToHVSC) |
float | getSTILVersionNo () |
const char * | getEntry (const char *relPathToEntry, int tuneNo=0, STILField field=all) |
const char * | getAbsEntry (const char *absPathToEntry, int tuneNo=0, STILField field=all) |
const char * | getGlobalComment (const char *relPathToEntry) |
const char * | getAbsGlobalComment (const char *absPathToEntry) |
const char * | getBug (const char *relPathToEntry, int tuneNo=0) |
const char * | getAbsBug (const char *absPathToEntry, int tuneNo=0) |
STILerror | getError () const |
bool | hasCriticalError () const |
const char * | getErrorStr () const |
Public Attributes | |
bool | STIL_DEBUG |
To turn debug output on. | |
STIL class
Given the location of HVSC this class can extract STIL information for a given tune of a given SID file. (Sounds simple, huh?)
PLEASE, READ THE ACCOMPANYING README.TXT FILE BEFORE PROCEEDING!!!!
enum STIL::STILerror |
Enum that describes the possible errors this class may encounter.
STIL::STIL | ( | const char * | stilPath = DEFAULT_PATH_TO_STIL , |
const char * | bugsPath = DEFAULT_PATH_TO_BUGLIST |
||
) |
Allocates necessary memory.
stilPath | relative path to STIL file |
bugsPath | relative path to BUG file |
const char * STIL::getAbsBug | ( | const char * | absPathToEntry, |
int | tuneNo = 0 |
||
) |
Same as getBug, but with an absolute path given in your machine's format.
const char * STIL::getAbsEntry | ( | const char * | absPathToEntry, |
int | tuneNo = 0 , |
||
STILField | field = all |
||
) |
Same as getEntry, but with an absolute path given given in your machine's format.
const char * STIL::getAbsGlobalComment | ( | const char * | absPathToEntry | ) |
Same as getGlobalComment, but with an absolute path given in your machine's format.
const char * STIL::getBug | ( | const char * | relPathToEntry, |
int | tuneNo = 0 |
||
) |
Given an HVSC pathname and tune number it returns a formatted string that contains the BUG entry for the tune number (if exists). If it doesn't exist, returns a NULL.
relPathToEntry | = relative to the HVSC base dir starting with a slash |
tuneNo | = song number within the song (default=0) If tuneNo=0, returns all of the BUG entry. |
NOTE: For older versions of STIL (older than v2.59) tuneNo is ignored and is assumed to be 0 to maintain backwards compatibility.
const char * STIL::getEntry | ( | const char * | relPathToEntry, |
int | tuneNo = 0 , |
||
STILField | field = all |
||
) |
Given an HVSC pathname, a tune number and a field designation, it returns a formatted string that contains the STIL field for the tune number (if exists). If it doesn't exist, returns a NULL.
relPathToEntry | = relative to the HVSC base dir, starting with a slash |
tuneNo | = song number within the song (default=0). |
field | = which field to retrieve (default=all). |
What the possible combinations of tuneNo and field represent:
NOTE: For older versions of STIL (older than v2.59) the tuneNo and field parameters are ignored and are assumed to be tuneNo=0 and field=all to maintain backwards compatibility.
|
inline |
Returns a specific error number identifying the problem that happened at the last invoked public method.
|
inline |
Returns an ASCII error string containing the description of the error that happened at the last invoked public method.
const char * STIL::getGlobalComment | ( | const char * | relPathToEntry | ) |
Given an HVSC pathname and tune number it returns a formatted string that contains the section-global comment for the tune number (if it exists). If it doesn't exist, returns a NULL.
relPathToEntry | = relative to the HVSC base dir starting with a slash |
float STIL::getSTILVersionNo | ( | ) |
Returns a floating number telling what the version number is of the STIL.txt file. To be called only after setBaseDir()!
const char * STIL::getVersion | ( | ) |
Returns a formatted string telling what the version number is for the STIL class and other info. If it is called after setBaseDir(), the string also has the STIL.txt file's version number in it.
float STIL::getVersionNo | ( | ) |
Returns a floating number telling what the version number is of this STIL class.
|
inline |
Returns true if the last error encountered was critical (ie. not one that the STIL class can recover from).
bool STIL::setBaseDir | ( | const char * | pathToHVSC | ) |
Tell the object where the HVSC base directory is - it figures that the STIL should be in /DOCUMENTS/STIL.txt and that the BUGlist should be in /DOCUMENTS/BUGlist.txt. It should not matter whether the path is given in UNIX, WinDOS, or Mac format (ie. '\' vs. '/' vs. ':')
pathToHVSC | = HVSC base directory in your machine's format |