Author: jbevain
Date: 2007-09-05 17:29:52 -0400 (Wed, 05 Sep 2007)
New Revision: 85384
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/playlist.cpp
Log:
2007-09-05 Jb Evain <[EMAIL PROTECTED]>
* playlist.cpp: the asx format is case insensitive, parse it
accordingly.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-09-05 21:03:16 UTC (rev 85383)
+++ trunk/moon/src/ChangeLog 2007-09-05 21:29:52 UTC (rev 85384)
@@ -1,3 +1,8 @@
+2007-09-05 Jb Evain <[EMAIL PROTECTED]>
+
+ * playlist.cpp: the asx format is case insensitive, parse it
+ accordingly.
+
2007-09-05 Sebastien Pouliot <[EMAIL PROTECTED]>
* animation.h: Make KeySpline::GetObjectType virtual.
Modified: trunk/moon/src/playlist.cpp
===================================================================
--- trunk/moon/src/playlist.cpp 2007-09-05 21:03:16 UTC (rev 85383)
+++ trunk/moon/src/playlist.cpp 2007-09-05 21:29:52 UTC (rev 85384)
@@ -229,39 +229,45 @@
XML_ParserFree (parser);
}
+static bool
+str_match (const char *candidate, const char *tag)
+{
+ return g_strcasecmp (candidate, tag) == 0;
+}
+
void
PlaylistParser::on_start_element (gpointer user_data, const char *name, const
char **attrs)
{
PlaylistParser *parser = reinterpret_cast<PlaylistParser *> (user_data);
PlaylistNodeKind kind;
//printf ("on_start_element, name: %s\n", name);
- if (!strcmp (name, "ABSTRACT")) {
+ if (str_match (name, "ABSTRACT")) {
kind = Abstract;
- } else if (!strcmp (name, "ASX")) {
+ } else if (str_match (name, "ASX")) {
kind = Asx;
- } else if (!strcmp (name, "AUTHOR")) {
+ } else if (str_match (name, "AUTHOR")) {
kind = Author;
- } else if (!strcmp (name, "BANNER")) {
+ } else if (str_match (name, "BANNER")) {
kind = Banner;
- } else if (!strcmp (name, "BASE")) {
+ } else if (str_match (name, "BASE")) {
kind = Base;
- } else if (!strcmp (name, "COPYRIGHT")) {
+ } else if (str_match (name, "COPYRIGHT")) {
kind = Copyright;
- } else if (!strcmp (name, "DURATION")) {
+ } else if (str_match (name, "DURATION")) {
kind = Duration;
- } else if (!strcmp (name, "ENTRY")) {
+ } else if (str_match (name, "ENTRY")) {
kind = Entry;
- } else if (!strcmp (name, "ENTRYREF")) {
+ } else if (str_match (name, "ENTRYREF")) {
kind = EntryRef;
- } else if (!strcmp (name, "LOGURL")) {
+ } else if (str_match (name, "LOGURL")) {
kind = LogUrl;
- } else if (!strcmp (name, "MOREINFO")) {
+ } else if (str_match (name, "MOREINFO")) {
kind = MoreInfo;
- } else if (!strcmp (name, "STARTTIME")) {
+ } else if (str_match (name, "STARTTIME")) {
kind = StartTime;
- } else if (!strcmp (name, "REF")) {
+ } else if (str_match (name, "REF")) {
kind = Ref;
- if (attrs && !strcmp (*attrs, "HREF"))
+ if (attrs && str_match (*attrs, "HREF"))
parser->GetCurrentEntry ()->SetSource (g_strdup
(*(attrs + 1)));
} else if (!strcmp (name, "TITLE")) {
kind = Title;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches