[xiph-commits] r8312 - in trunk/oggdsf/src/lib/codecs/cmml:
libCMMLTags libWinCMMLParse
illiminable at motherfish-iii.xiph.org
illiminable at motherfish-iii.xiph.org
Tue Nov 30 06:01:29 PST 2004
Author: illiminable
Date: 2004-11-30 06:01:28 -0800 (Tue, 30 Nov 2004)
New Revision: 8312
Modified:
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.h
trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.cpp
trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.h
Log:
* Making CMML Parser more robust.
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -57,40 +57,40 @@
}
//Accessors
-string C_AnchorTag::cls() {
+wstring C_AnchorTag::cls() {
return mCls;
}
-string C_AnchorTag::href() {
+wstring C_AnchorTag::href() {
return mHref;
}
//Mutators
-void C_AnchorTag::setCls(string inCls) {
+void C_AnchorTag::setCls(wstring inCls) {
mCls = inCls;
}
-void C_AnchorTag::setHref(string inHref) {
+void C_AnchorTag::setHref(wstring inHref) {
mHref = inHref;
}
//Other
-string C_AnchorTag::toString() {
+wstring C_AnchorTag::toString() {
//TO DO:::
- string retStr = "<a";
+ wstring retStr = L"<a";
//Put in the id element if there is one
if (mId.size() != 0) {
- retStr += makeElement("id", mId);
+ retStr += makeElement(L"id", mId);
}
if (mCls.size() != 0) {
- retStr += makeElement("class", mCls);
+ retStr += makeElement(L"class", mCls);
}
- retStr += makeElement("href", mHref);
+ retStr += makeElement(L"href", mHref);
- retStr += ">";
+ retStr += L">";
retStr += mText;
- retStr += "</a>\n";
+ retStr += L"</a>\n";
return retStr;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -51,22 +51,22 @@
virtual ~C_AnchorTag(void);
//Accessors
- string cls();
- string href();
+ wstring cls();
+ wstring href();
//Mutators
- void setCls(string inCls);
- void setHref(string inHref);
+ void setCls(wstring inCls);
+ void setHref(wstring inHref);
//Other
- virtual string toString();
+ virtual wstring toString();
C_AnchorTag* clone();
virtual C_CMMLTag* genericClone();
protected:
//Property Data
- string mCls;
- string mHref;
+ wstring mCls;
+ wstring mHref;
//Protected Helper Methods
virtual void privateClone(C_CMMLTag* outTag);
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -45,12 +45,12 @@
}
//Accessors
-string C_BaseTag::href() {
+wstring C_BaseTag::href() {
return mHref;
}
//Mutators
-void C_BaseTag::setHref(string inHref) {
+void C_BaseTag::setHref(wstring inHref) {
mHref = inHref;
}
@@ -64,16 +64,16 @@
C_CMMLTag* C_BaseTag::genericClone() {
return clone();
}
-string C_BaseTag::toString() {
+wstring C_BaseTag::toString() {
//FIX ::: Make this do something
- string retStr = "<base";
+ wstring retStr = L"<base";
if (mId.size() != 0) {
- retStr += makeElement("id", mId);
+ retStr += makeElement(L"id", mId);
}
- retStr += makeElement("href", mHref);
- retStr += "/>\n";
+ retStr += makeElement(L"href", mHref);
+ retStr += L"/>\n";
return retStr;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -50,19 +50,19 @@
virtual ~C_BaseTag(void);
//Accessors
- string href();
+ wstring href();
//Mutators
- void setHref(string inHref);
+ void setHref(wstring inHref);
//Other
- virtual string toString();
+ virtual wstring toString();
C_BaseTag* clone();
virtual C_CMMLTag* genericClone();
protected:
//Property Data
- string mHref;
+ wstring mHref;
//Protected Helper Methods
virtual void privateClone(C_CMMLTag* outTag);
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -55,8 +55,8 @@
delete mRoot;
mRoot = inRootTag;
}
-string C_CMMLDoc::toString() {
- string retStr = mPreamble->toString();
+wstring C_CMMLDoc::toString() {
+ wstring retStr = mPreamble->toString();
retStr += mRoot->toString();
return retStr;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -67,15 +67,15 @@
void setRoot(C_CMMLRootTag* inRootTag);
- virtual string toString();
+ virtual wstring toString();
C_CMMLDoc* clone();
//Opening files
- //bool open(string inFilename);
- //bool open(string inFilename, CMMLReadStreamCB inStreamCB, CMMLReadHeadCB inHeadCB, CMMLReadClipCB inClipCB);
+ //bool open(wstring inFilename);
+ //bool open(wstring inFilename, CMMLReadStreamCB inStreamCB, CMMLReadHeadCB inHeadCB, CMMLReadClipCB inClipCB);
//ISSUE ::: Void pointer on interface...
- //bool open(string inFilename, CMMLReadStreamCB inStreamCB, CMMLReadHeadCB inHeadCB, CMMLReadClipCB inClipCB, void* inUserData);
+ //bool open(wstring inFilename, CMMLReadStreamCB inStreamCB, CMMLReadHeadCB inHeadCB, CMMLReadClipCB inClipCB, void* inUserData);
//ISSUE ::: Find a way to allow the passing in of a fstream
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -36,9 +36,9 @@
C_CMMLPreamble::C_CMMLPreamble(void)
{
- mXmlVersion = "1.0";
- mXmlEncoding = "UTF-8";
- mXmlStandAlone = "yes";
+ mXmlVersion = L"1.0";
+ mXmlEncoding = L"UTF-8";
+ mXmlStandAlone = L"yes";
}
@@ -47,42 +47,42 @@
}
//Accessors
-string C_CMMLPreamble::xmlVersion() {
+wstring C_CMMLPreamble::xmlVersion() {
return mXmlVersion;
}
-string C_CMMLPreamble::xmlEncoding() {
+wstring C_CMMLPreamble::xmlEncoding() {
return mXmlEncoding;
}
-string C_CMMLPreamble::xmlStandAlone() {
+wstring C_CMMLPreamble::xmlStandAlone() {
return mXmlStandAlone;
}
//Mutators
-void C_CMMLPreamble::setXmlVersion(string inVersion) {
+void C_CMMLPreamble::setXmlVersion(wstring inVersion) {
}
-void C_CMMLPreamble::setXmlEncoding(string inEncoding) {
+void C_CMMLPreamble::setXmlEncoding(wstring inEncoding) {
}
-void C_CMMLPreamble::setXmlStandAlone(string inStandAlone) {
+void C_CMMLPreamble::setXmlStandAlone(wstring inStandAlone) {
}
//Others
-string C_CMMLPreamble::toString() {
- string retStr;
- retStr = "<?xml version=\"";
+wstring C_CMMLPreamble::toString() {
+ wstring retStr;
+ retStr = L"<?xml version=\"";
retStr += mXmlVersion;
- retStr += "\" encoding=\"";
+ retStr += L"\" encoding=\"";
retStr += mXmlEncoding;
- retStr += "\" standalone=\"";
+ retStr += L"\" standalone=\"";
retStr += mXmlStandAlone;
- retStr += "\"?>\n";
+ retStr += L"\"?>\n";
//TO DO::: Make this more generalised properly
- retStr += "<!DOCTYPE cmml SYSTEM \"cmml.dtd\">\n";
+ retStr += L"<!DOCTYPE cmml SYSTEM \"cmml.dtd\">\n";
return retStr;
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -45,17 +45,17 @@
virtual ~C_CMMLPreamble(void);
//Accessors
- string xmlVersion();
- string xmlEncoding();
- string xmlStandAlone();
+ wstring xmlVersion();
+ wstring xmlEncoding();
+ wstring xmlStandAlone();
//Mutators
- void setXmlVersion(string inVersion);
- void setXmlEncoding(string inEncoding);
- void setXmlStandAlone(string inStandAlone);
+ void setXmlVersion(wstring inVersion);
+ void setXmlEncoding(wstring inEncoding);
+ void setXmlStandAlone(wstring inStandAlone);
//Others
- virtual string toString();
+ virtual wstring toString();
protected:
@@ -73,7 +73,7 @@
//} CMML_Preamble;
//Property Data
- string mXmlVersion;
- string mXmlEncoding;
- string mXmlStandAlone;
+ wstring mXmlVersion;
+ wstring mXmlEncoding;
+ wstring mXmlStandAlone;
};
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -97,29 +97,29 @@
}
-string C_CMMLRootTag::toString() {
- string retStr;
- retStr = "<cmml";
+wstring C_CMMLRootTag::toString() {
+ wstring retStr;
+ retStr = L"<cmml";
if (mId.size() != 0) {
- retStr += makeElement("id", mId);
+ retStr += makeElement(L"id", mId);
}
if (mLang.size() != 0) {
- retStr += makeElement("lang", mLang);
+ retStr += makeElement(L"lang", mLang);
//Assuming that if lang is set then so is dirn.
//Also lets dirn default to "ltr" and still not be displayed
//unless the language is defined
- retStr += makeElement("dir", mDirn);
+ retStr += makeElement(L"dir", mDirn);
}
- retStr += ">\n";
+ retStr += L">\n";
if (mStream != NULL) {
retStr += mStream->toString();
}
retStr += mHead->toString();
retStr += mClipList->toString();
- retStr += "</cmml>\n";
+ retStr += L"</cmml>\n";
return retStr;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -65,7 +65,7 @@
void setClipList(C_ClipTagList* inClipList);
//Other
- virtual string toString();
+ virtual wstring toString();
virtual C_CMMLTag* genericClone();
C_CMMLRootTag* clone();
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -43,19 +43,19 @@
}
//Accessors
-string C_CMMLTag::id() {
+wstring C_CMMLTag::id() {
return mId;
}
//Mutators
-void C_CMMLTag::setId(string inId) {
+void C_CMMLTag::setId(wstring inId) {
mId = inId;
}
//Protected Helper Methods
-string C_CMMLTag::makeElement(string inElemName, string inElemContent) {
- string retStr;
- retStr = " " + inElemName + "=\"" + inElemContent + "\"";
+wstring C_CMMLTag::makeElement(wstring inElemName, wstring inElemContent) {
+ wstring retStr;
+ retStr = L" " + inElemName + L"=\"" + inElemContent + L"\"";
return retStr;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -41,7 +41,7 @@
// This is the base class for all tags. This is an abstract class.
//PURE VIRTUAL FUNCTIONS
-// string toString(); //Turn the tag to a string
+// wstring toString(); //Turn the tag to a string
class LIBCMMLTAGS_API C_CMMLTag
{
@@ -71,20 +71,20 @@
};
//Accessors
- string id();
+ wstring id();
//Mutators
- void setId(string inId);
+ void setId(wstring inId);
//Other
- virtual string toString() = 0;
+ virtual wstring toString() = 0;
protected:
//Property Data
- string mId;
+ wstring mId;
eTagType mTagType;
//Protected Helper Methods
virtual void privateClone(C_CMMLTag* outTag);
- string makeElement(string inElemName, string inElemContent);
+ wstring makeElement(wstring inElemName, wstring inElemContent);
};
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -10,11 +10,11 @@
}
//Accessors
-string C_CMMLTime::time() {
+wstring C_CMMLTime::time() {
return mTime;
}
//Mutators
-void C_CMMLTime::setTime(string inTime) {
+void C_CMMLTime::setTime(wstring inTime) {
mTime = inTime;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -10,13 +10,13 @@
~C_CMMLTime(void);
//Accessors
- string time();
+ wstring time();
//Mutators
- void setTime(string inTime);
+ void setTime(wstring inTime);
//Temporarily just a string container
protected:
- string mTime;
+ wstring mTime;
};
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -43,7 +43,7 @@
mAnchor = NULL;
mImage = NULL;
mDesc = NULL;
- mStart = "0";
+ mStart = L"0";
}
C_ClipTag::~C_ClipTag(void)
@@ -55,7 +55,7 @@
}
//Accessors
-string C_ClipTag::track() {
+wstring C_ClipTag::track() {
return mTrack;
}
C_MetaTagList* C_ClipTag::metaList() {
@@ -71,14 +71,14 @@
return mDesc;
}
-string C_ClipTag::start() {
+wstring C_ClipTag::start() {
return mStart;
}
-string C_ClipTag::end() {
+wstring C_ClipTag::end() {
return mEnd;
}
//Mutators
-void C_ClipTag::setTrack(string inTrack) {
+void C_ClipTag::setTrack(wstring inTrack) {
mTrack = inTrack;
}
void C_ClipTag::setAnchor(C_AnchorTag* inAnchor) {
@@ -94,12 +94,12 @@
mDesc = inDesc;
}
-void C_ClipTag::setStart(string inStart) {
- if (inStart != "") {
+void C_ClipTag::setStart(wstring inStart) {
+ if (inStart != L"") {
mStart = inStart;
}
}
-void C_ClipTag::setEnd(string inEnd) {
+void C_ClipTag::setEnd(wstring inEnd) {
mEnd = inEnd;
}
@@ -125,29 +125,29 @@
locTag->setStart(mStart);
locTag->setEnd(mEnd);
}
-string C_ClipTag::toString() {
- string retStr = "<clip";
+wstring C_ClipTag::toString() {
+ wstring retStr = L"<clip";
//TO DO::: Language data ???
//Id element
- if (mId != "") {
- retStr += makeElement("id", mId);
+ if (mId != L"") {
+ retStr += makeElement(L"id", mId);
}
//track Element
- if (mTrack != "") {
- retStr += makeElement("track", mTrack);
+ if (mTrack != L"") {
+ retStr += makeElement(L"track", mTrack);
}
//TO DO::: Sort out what to do about start and end
- retStr += makeElement("start", mStart);
+ retStr += makeElement(L"start", mStart);
- if (mEnd != "") {
- retStr += makeElement("end", mEnd);
+ if (mEnd != L"") {
+ retStr += makeElement(L"end", mEnd);
}
- retStr += ">\n";
+ retStr += L">\n";
if (mAnchor != NULL) {
retStr += mAnchor->toString();
@@ -160,6 +160,6 @@
}
retStr += mMetaList->toString();
- retStr += "</clip>\n\n";
+ retStr += L"</clip>\n\n";
return retStr;
}
\ No newline at end of file
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -57,41 +57,41 @@
//Accessors
- string track();
+ wstring track();
C_MetaTagList* metaList();
C_AnchorTag* anchor();
C_ImageTag* image();
C_DescTag* desc();
- string start();
- string end();
+ wstring start();
+ wstring end();
//Mutators
- void setTrack(string inTrack);
+ void setTrack(wstring inTrack);
void setAnchor(C_AnchorTag* inAnchor);
void setImage(C_ImageTag* inImage);
void setDesc(C_DescTag* inDesc);
- void setStart(string inStart);
- void setEnd(string inEnd);
+ void setStart(wstring inStart);
+ void setEnd(wstring inEnd);
//Others
- virtual string toString();
+ virtual wstring toString();
C_ClipTag* clone();
virtual C_CMMLTag* genericClone();
protected:
//Property Data
- string mTrack;
+ wstring mTrack;
C_MetaTagList* mMetaList;
C_AnchorTag* mAnchor;
C_ImageTag* mImage;
C_DescTag* mDesc;
- string mStart;
- string mEnd;
+ wstring mStart;
+ wstring mEnd;
//Protected Helper Methods
virtual void privateClone(C_CMMLTag* outTag);
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -44,8 +44,8 @@
}
-string C_ClipTagList::toString() {
- string retStr = "";
+wstring C_ClipTagList::toString() {
+ wstring retStr = L"";
for (unsigned long i = 0; i < mTagList.size(); i++) {
retStr += mTagList[i]->toString();
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -52,7 +52,7 @@
virtual ~C_ClipTagList(void);
- virtual string toString();
+ virtual wstring toString();
C_ClipTagList* clone();
void addTag(C_ClipTag* inTag);
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -45,15 +45,15 @@
//Other
-string C_DescTag::toString() {
+wstring C_DescTag::toString() {
//FIX ::: Make this do something
- string retStr = "<desc";
+ wstring retStr = L"<desc";
if (mId.size() != 0) {
- retStr += makeElement("id", mId);
+ retStr += makeElement(L"id", mId);
}
- retStr += ">";
+ retStr += L">";
retStr += mText;
- retStr += "</desc>\n";
+ retStr += L"</desc>\n";
return retStr;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -50,7 +50,7 @@
virtual ~C_DescTag(void);
//Other
- virtual string toString();
+ virtual wstring toString();
C_DescTag* clone();
virtual C_CMMLTag* genericClone();
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -51,7 +51,7 @@
}
//Accessors
-string C_HeadTag::profile() {
+wstring C_HeadTag::profile() {
return mProfile;
}
C_TitleTag* C_HeadTag::title() {
@@ -64,7 +64,7 @@
return mMetaList;
}
//Mutators
-void C_HeadTag::setProfile(string inProfile) {
+void C_HeadTag::setProfile(wstring inProfile) {
mProfile = inProfile;
}
void C_HeadTag::setTitle(C_TitleTag* inTitle) {
@@ -98,22 +98,22 @@
}
-string C_HeadTag::toString() {
+wstring C_HeadTag::toString() {
//TO DO::: Optional tags
- string retStr = "<head";
+ wstring retStr = L"<head";
if (mId.size() != 0) {
- retStr += " id=\"";
+ retStr += L" id=\"";
retStr += mId;
- retStr += "\"";
+ retStr += L"\"";
}
if (mProfile.size() != 0) {
- retStr += " profile=\"";
+ retStr += L" profile=\"";
retStr += mProfile;
- retStr += "\"";
+ retStr += L"\"";
}
- retStr+= ">\n";
+ retStr+= L">\n";
if (mBase != NULL) {
retStr += mBase->toString();
@@ -121,6 +121,6 @@
retStr += mTitle->toString();
retStr += mMetaList->toString();
- retStr += "</head>\n\n";
+ retStr += L"</head>\n\n";
return retStr;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -53,23 +53,23 @@
virtual ~C_HeadTag(void);
//Accessors
- string profile();
+ wstring profile();
C_TitleTag* title();
C_BaseTag* base();
C_MetaTagList* metaList();
//Mutators
- void setProfile(string inProfile);
+ void setProfile(wstring inProfile);
void setTitle(C_TitleTag* inTitle);
void setBase(C_BaseTag* inBase);
//Other
- virtual string toString();
+ virtual wstring toString();
C_HeadTag* clone();
virtual C_CMMLTag* genericClone();
protected:
//Property Data
- string mProfile;
+ wstring mProfile;
C_TitleTag* mTitle;
C_BaseTag* mBase;
C_MetaTagList* mMetaList;
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -43,18 +43,18 @@
}
//Accessors
-string C_HumReadCMMLTag::lang() {
+wstring C_HumReadCMMLTag::lang() {
return mLang;
}
-string C_HumReadCMMLTag::dirn() {
+wstring C_HumReadCMMLTag::dirn() {
return mDirn;
}
//Mutators
-void C_HumReadCMMLTag::setLang(string inLang) {
+void C_HumReadCMMLTag::setLang(wstring inLang) {
mLang = inLang;
}
-void C_HumReadCMMLTag::setDirn(string inDirn) {
+void C_HumReadCMMLTag::setDirn(wstring inDirn) {
mDirn = inDirn;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -49,20 +49,20 @@
virtual ~C_HumReadCMMLTag(void);
//Accessors
- string lang();
- string dirn();
+ wstring lang();
+ wstring dirn();
//Mutators
- void setLang(string inLang);
- void setDirn(string inDirn);
+ void setLang(wstring inLang);
+ void setDirn(wstring inDirn);
//Other
- virtual string toString() = 0;
+ virtual wstring toString() = 0;
protected:
//Property Data
- string mLang;
- string mDirn;
+ wstring mLang;
+ wstring mDirn;
//Protected Helper Methods
virtual void privateClone(C_CMMLTag* outTag);
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -44,18 +44,18 @@
}
//Accessors
-string C_ImageTag::src() {
+wstring C_ImageTag::src() {
return mSrc;
}
-string C_ImageTag::alt() {
+wstring C_ImageTag::alt() {
return mAlt;
}
//Mutators
-void C_ImageTag::setSrc(string inSrc) {
+void C_ImageTag::setSrc(wstring inSrc) {
mSrc = inSrc;
}
-void C_ImageTag::setAlt(string inAlt) {
+void C_ImageTag::setAlt(wstring inAlt) {
mAlt = inAlt;
}
@@ -77,18 +77,18 @@
C_CMMLTag* C_ImageTag::genericClone() {
return clone();
}
-string C_ImageTag::toString() {
- string retStr = "<img";
+wstring C_ImageTag::toString() {
+ wstring retStr = L"<img";
if (mId.size() != 0) {
- retStr += makeElement("id", mId);
+ retStr += makeElement(L"id", mId);
}
- retStr += makeElement("src", mSrc);
+ retStr += makeElement(L"src", mSrc);
if (mAlt.size() != 0) {
- retStr += makeElement("alt", mAlt);
+ retStr += makeElement(L"alt", mAlt);
}
- retStr += "/>\n";
+ retStr += L"/>\n";
return retStr;
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -50,21 +50,21 @@
virtual ~C_ImageTag(void);
//Accessors
- string src();
- string alt();
+ wstring src();
+ wstring alt();
//Mutators
- void setSrc(string inSrc);
- void setAlt(string inAlt);
+ void setSrc(wstring inSrc);
+ void setAlt(wstring inAlt);
//Other
- virtual string toString();
+ virtual wstring toString();
C_ImageTag* clone();
virtual C_CMMLTag* genericClone();
protected:
//Property Data
- string mSrc;
- string mAlt;
+ wstring mSrc;
+ wstring mAlt;
//Protected Helper Methods
virtual void privateClone(C_CMMLTag* outTag);
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -37,7 +37,7 @@
C_ImportTag::C_ImportTag(void)
{
mTagType = C_CMMLTag::eTagType::IMPORT;
- mStart = "0";
+ mStart = L"0";
mParamList = new C_ParamTagList;
}
@@ -48,22 +48,22 @@
//Accessors
-string C_ImportTag::granuleRate() {
+wstring C_ImportTag::granuleRate() {
return mGranuleRate;
}
-string C_ImportTag::contentType() {
+wstring C_ImportTag::contentType() {
return mContentType;
}
-string C_ImportTag::src() {
+wstring C_ImportTag::src() {
return mSrc;
}
-string C_ImportTag::start() {
+wstring C_ImportTag::start() {
return mStart;
}
-string C_ImportTag::end() {
+wstring C_ImportTag::end() {
return mEnd;
}
-string C_ImportTag::title() {
+wstring C_ImportTag::title() {
return mTitle;
}
C_ParamTagList* C_ImportTag::paramList() {
@@ -71,22 +71,22 @@
}
//Mutators
-void C_ImportTag::setGranuleRate(string inGranuleRate) {
+void C_ImportTag::setGranuleRate(wstring inGranuleRate) {
mGranuleRate = inGranuleRate;
}
-void C_ImportTag::setContentType(string inContentType) {
+void C_ImportTag::setContentType(wstring inContentType) {
mContentType = inContentType;
}
-void C_ImportTag::setSrc(string inSrc) {
+void C_ImportTag::setSrc(wstring inSrc) {
mSrc = inSrc;
}
-void C_ImportTag::setStart(string inStart) {
+void C_ImportTag::setStart(wstring inStart) {
mStart = inStart;
}
-void C_ImportTag::setEnd(string inEnd) {
+void C_ImportTag::setEnd(wstring inEnd) {
mEnd = inEnd;
}
-void C_ImportTag::setTitle(string inTitle) {
+void C_ImportTag::setTitle(wstring inTitle) {
mTitle = inTitle;
}
void C_ImportTag::setParamList(C_ParamTagList* inParamList) {
@@ -118,38 +118,38 @@
C_CMMLTag* C_ImportTag::genericClone() {
return clone();
}
-string C_ImportTag::toString() {
+wstring C_ImportTag::toString() {
- string retStr;
- retStr = "<import";
+ wstring retStr;
+ retStr = L"<import";
if (mId.size() != 0) {
- retStr += makeElement("id", mId);
+ retStr += makeElement(L"id", mId);
}
if (mGranuleRate.size() != 0) {
- retStr += makeElement("granulerate", mGranuleRate);
+ retStr += makeElement(L"granulerate", mGranuleRate);
}
if (mContentType.size() != 0) {
- retStr += makeElement("contenttype", mContentType);
+ retStr += makeElement(L"contenttype", mContentType);
}
- retStr += makeElement("src", mSrc);
- retStr += makeElement("start", mStart);
+ retStr += makeElement(L"src", mSrc);
+ retStr += makeElement(L"start", mStart);
if (mEnd.size() != 0) {
- retStr += makeElement("end", mEnd);
+ retStr += makeElement(L"end", mEnd);
}
if (mTitle.size() != 0) {
- retStr += makeElement("title", mTitle);
+ retStr += makeElement(L"title", mTitle);
}
- retStr += ">\n";
+ retStr += L">\n";
retStr += mParamList->toString();
- retStr += "</import>\n";
+ retStr += L"</import>\n";
return retStr;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -52,25 +52,25 @@
virtual ~C_ImportTag(void);
//Accessors
- string granuleRate();
- string contentType();
- string src();
- string start();
- string end();
- string title();
+ wstring granuleRate();
+ wstring contentType();
+ wstring src();
+ wstring start();
+ wstring end();
+ wstring title();
C_ParamTagList* paramList();
//Mutators
- void setGranuleRate(string inGranuleRate);
- void setContentType(string inContentType);
- void setSrc(string inSrc);
- void setStart(string inStart);
- void setEnd(string inEnd);
- void setTitle(string inTitle);
+ void setGranuleRate(wstring inGranuleRate);
+ void setContentType(wstring inContentType);
+ void setSrc(wstring inSrc);
+ void setStart(wstring inStart);
+ void setEnd(wstring inEnd);
+ void setTitle(wstring inTitle);
void setParamList(C_ParamTagList* inParamList);
//Other
- virtual string toString();
+ virtual wstring toString();
C_ImportTag* clone();
virtual C_CMMLTag* genericClone();
@@ -78,12 +78,12 @@
//Property Data
//FIX ::: Change this to appropriate integer type ??
- string mGranuleRate;
- string mContentType;
- string mSrc;
- string mStart;
- string mEnd;
- string mTitle;
+ wstring mGranuleRate;
+ wstring mContentType;
+ wstring mSrc;
+ wstring mStart;
+ wstring mEnd;
+ wstring mTitle;
C_ParamTagList* mParamList;
//Protected Helper Methods
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -44,8 +44,8 @@
}
-string C_ImportTagList::toString() {
- string retStr;
+wstring C_ImportTagList::toString() {
+ wstring retStr;
for (unsigned long i = 0; i < mTagList.size(); i++) {
retStr += mTagList[i]->toString();
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -49,7 +49,7 @@
C_ImportTagList(void);
virtual ~C_ImportTagList(void);
- virtual string toString();
+ virtual wstring toString();
C_ImportTagList* clone();
void addTag(C_ImportTag* inTag);
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -42,24 +42,24 @@
C_MappedTag::~C_MappedTag(void)
{
}
-C_MappedTag::C_MappedTag(string inName, string inContent) {
+C_MappedTag::C_MappedTag(wstring inName, wstring inContent) {
mName = inName;
mContent = inContent;
}
//accessors
-string C_MappedTag::name() {
+wstring C_MappedTag::name() {
return mName;
}
-string C_MappedTag::content() {
+wstring C_MappedTag::content() {
return mContent;
}
//mutators
-void C_MappedTag::setName(string inName) {
+void C_MappedTag::setName(wstring inName) {
mName = inName;
}
-void C_MappedTag::setContent(string inContent) {
+void C_MappedTag::setContent(wstring inContent) {
mContent = inContent;
}
void C_MappedTag::privateClone(C_CMMLTag* outTag) {
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -47,25 +47,25 @@
public:
//Constructors
C_MappedTag(void);
- C_MappedTag(string inName, string inContent);
+ C_MappedTag(wstring inName, wstring inContent);
virtual ~C_MappedTag(void);
//Accessors
- string name();
- string content();
+ wstring name();
+ wstring content();
//Mutators
- void setName(string inName);
- void setContent(string inContent);
+ void setName(wstring inName);
+ void setContent(wstring inContent);
//Other
- virtual string toString() = 0;
+ virtual wstring toString() = 0;
virtual C_MappedTag* mappedClone() = 0;
protected:
//Property Data
- string mName;
- string mContent;
+ wstring mName;
+ wstring mContent;
//Protected Helper Methods
virtual void privateClone(C_CMMLTag* outTag);
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -51,7 +51,7 @@
mTagList.push_back(inTag);
}
-//void C_MappedTagList::addTag(string inName, string inContent) {
+//void C_MappedTagList::addTag(wstring inName, wstring inContent) {
// C_MappedTag* locMappedTag = new C_MappedTag(inName, inContent);
// addTag(locMappedTag);
//}
@@ -69,7 +69,7 @@
return NULL;
}
}
-C_MappedTag* C_MappedTagList::getTag(string inName) {
+C_MappedTag* C_MappedTagList::getTag(wstring inName) {
unsigned long i = 0;
unsigned long locSize = (unsigned long)mTagList.size();
@@ -84,13 +84,13 @@
return NULL;
}
-string C_MappedTagList::getContent(string inName) {
+wstring C_MappedTagList::getContent(wstring inName) {
return getTag(inName)->name();
}
-string C_MappedTagList::toString() {
+wstring C_MappedTagList::toString() {
//FIX ::: Make this do something
- string retStr = "";
+ wstring retStr = L"";
return retStr;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -48,17 +48,17 @@
virtual ~C_MappedTagList(void);
//What to do about this ? **** They are now protected dervied classes implement themselves
- //void addTag(string inName, string inContent);
+ //void addTag(wstring inName, wstring inContent);
//void removeTag ???
unsigned long numTags();
- string getContent(string mName);
+ wstring getContent(wstring mName);
//Maybe not !
- //void addTag(string inName, string inContent);
+ //void addTag(wstring inName, wstring inContent);
- virtual string toString() = 0;
+ virtual wstring toString() = 0;
@@ -66,7 +66,7 @@
vector<C_MappedTag*> mTagList;
C_MappedTag* getTag(unsigned long inTagNo);
- C_MappedTag* getTag(string mName);
+ C_MappedTag* getTag(wstring mName);
void addTag(C_MappedTag* inTag);
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -43,12 +43,12 @@
{
}
//Accessors
-string C_MetaTag::scheme() {
+wstring C_MetaTag::scheme() {
return mScheme;
}
//Mutators
-void C_MetaTag::setScheme(string inScheme) {
+void C_MetaTag::setScheme(wstring inScheme) {
mScheme = inScheme;
}
@@ -71,15 +71,15 @@
C_MappedTag* C_MetaTag::mappedClone() {
return clone();
}
-string C_MetaTag::toString() {
+wstring C_MetaTag::toString() {
//QUERY ::: How are the internationalisation tags included
- string retStr = "<meta";
- retStr += " name=\"";
+ wstring retStr = L"<meta";
+ retStr += L" name=\"";
retStr += mName;
- retStr += "\" content=\"";
+ retStr += L"\" content=\"";
retStr += mContent;
- retStr += "\"";
- retStr += "/>\n";
+ retStr += L"\"";
+ retStr += L"/>\n";
return retStr;
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -50,20 +50,20 @@
virtual ~C_MetaTag(void);
//Accessors
- string scheme();
+ wstring scheme();
//Mutators
- void setScheme(string inScheme);
+ void setScheme(wstring inScheme);
//Other
- virtual string toString();
+ virtual wstring toString();
C_MetaTag* clone();
virtual C_CMMLTag* genericClone();
virtual C_MappedTag* mappedClone();
protected:
//Property Data
- string mScheme;
+ wstring mScheme;
//Protected Helper Methods
virtual void privateClone(C_CMMLTag* outTag);
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -49,7 +49,7 @@
}
-void C_MetaTagList::addTag(string inName, string inContent) {
+void C_MetaTagList::addTag(wstring inName, wstring inContent) {
C_MetaTag* retTag = new C_MetaTag;
retTag->setName(inName);
retTag->setContent(inContent);
@@ -62,17 +62,17 @@
C_MetaTag* C_MetaTagList::getTag(unsigned long inTagNo) {
return (C_MetaTag*) mTagList[inTagNo];
}
-C_MetaTag* C_MetaTagList::getTag(string inName) {
+C_MetaTag* C_MetaTagList::getTag(wstring inName) {
return (C_MetaTag*) C_MappedTagList::getTag(inName);
}
-string C_MetaTagList::getContent(string inName) {
+wstring C_MetaTagList::getContent(wstring inName) {
return getTag(inName)->content();
}
-string C_MetaTagList::toString() {
+wstring C_MetaTagList::toString() {
- string retStr;
+ wstring retStr;
for (unsigned long i = 0; i < mTagList.size(); i++) {
retStr+=mTagList[i]->toString();
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -43,16 +43,16 @@
virtual ~C_MetaTagList(void);
void addTag(C_MetaTag* inTag);
- void addTag(string inName, string inContent);
+ void addTag(wstring inName, wstring inContent);
//void removeTag ???
//unsigned long numTags();
C_MetaTag* getTag(unsigned long inTagNo);
- C_MetaTag* getTag(string inName);
+ C_MetaTag* getTag(wstring inName);
- string getContent(string inName);
+ wstring getContent(wstring inName);
- virtual string toString();
+ virtual wstring toString();
C_MetaTagList* clone();
protected:
//Protected Helper Methods
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -42,12 +42,12 @@
{
}
-string C_ParamTag::toString() {
- string retStr;
- retStr = "<param";
- retStr += makeElement("name", mName);
- retStr += makeElement("value", mContent);
- retStr += "/>\n";
+wstring C_ParamTag::toString() {
+ wstring retStr;
+ retStr = L"<param";
+ retStr += makeElement(L"name", mName);
+ retStr += makeElement(L"value", mContent);
+ retStr += L"/>\n";
return retStr;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -50,7 +50,7 @@
virtual ~C_ParamTag(void);
//Other
- virtual string toString();
+ virtual wstring toString();
C_ParamTag* clone();
virtual C_CMMLTag* genericClone();
virtual C_MappedTag* mappedClone();
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -42,9 +42,9 @@
{
//Everything is deleted by the base class
}
-string C_ParamTagList::toString() {
+wstring C_ParamTagList::toString() {
- string retStr = "";
+ wstring retStr = L"";
for (unsigned long i = 0; i < mTagList.size(); i++) {
retStr += mTagList[i]->toString();
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -59,7 +59,7 @@
//Other
- virtual string toString();
+ virtual wstring toString();
C_ParamTagList* clone();
};
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -38,7 +38,7 @@
{
mTagType = C_CMMLTag::eTagType::STREAM;
mImportList = new C_ImportTagList;
- mTimebase = "0";
+ mTimebase = L"0";
}
C_StreamTag::~C_StreamTag(void)
@@ -47,10 +47,10 @@
}
//Accessors
-string C_StreamTag::timebase() {
+wstring C_StreamTag::timebase() {
return mTimebase;
}
-string C_StreamTag::utc() {
+wstring C_StreamTag::utc() {
return mUtc;
}
C_ImportTagList* C_StreamTag::importList() {
@@ -58,10 +58,10 @@
}
//Mutators
-void C_StreamTag::setTimebase(string inTimebase) {
+void C_StreamTag::setTimebase(wstring inTimebase) {
mTimebase = inTimebase;
}
-void C_StreamTag::setUtc(string inUtc) {
+void C_StreamTag::setUtc(wstring inUtc) {
mUtc = inUtc;
}
@@ -89,21 +89,21 @@
C_CMMLTag* C_StreamTag::genericClone() {
return clone();
}
-string C_StreamTag::toString() {
+wstring C_StreamTag::toString() {
//FIX ::: Make this do something
- string retStr;
+ wstring retStr;
- retStr = "<stream";
+ retStr = L"<stream";
if (mId.size() != 0) {
- retStr += makeElement("id", mId);
+ retStr += makeElement(L"id", mId);
}
- retStr += makeElement("timebase", mTimebase);
+ retStr += makeElement(L"timebase", mTimebase);
if (mUtc.size() != 0) {
- retStr += makeElement("utc", mUtc);
+ retStr += makeElement(L"utc", mUtc);
}
- retStr += ">\n";
+ retStr += L">\n";
retStr += mImportList->toString();
- retStr += "</stream>\n\n";
+ retStr += L"</stream>\n\n";
return retStr;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -51,17 +51,17 @@
virtual ~C_StreamTag(void);
//Accessors
- string timebase();
- string utc();
+ wstring timebase();
+ wstring utc();
C_ImportTagList* importList();
//Mutators
- void setTimebase(string inTimebase);
- void setUtc(string inUtc);
+ void setTimebase(wstring inTimebase);
+ void setUtc(wstring inUtc);
void setImportList(C_ImportTagList* inTagList);
//Other
- virtual string toString();
+ virtual wstring toString();
C_StreamTag* clone();
virtual C_CMMLTag* genericClone();
@@ -69,8 +69,8 @@
protected:
//Property Data
- string mTimebase;
- string mUtc;
+ wstring mTimebase;
+ wstring mUtc;
C_ImportTagList* mImportList;
//Protected Helper Methods
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -66,9 +66,9 @@
}
}
-string C_TagList::toString() {
+wstring C_TagList::toString() {
//Return the CMML of the list of tags appended together
- string retStr = "";
+ wstring retStr = L"";
for (unsigned long i = 0; i < mTagList.size(); i++) {
retStr.append(mTagList[i]->toString());
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -55,7 +55,7 @@
unsigned long numTags();
//Other
- virtual string toString() = 0;
+ virtual wstring toString() = 0;
protected:
//Property Data
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -43,12 +43,12 @@
}
//Accessors
-string C_TextFieldTag::text() {
+wstring C_TextFieldTag::text() {
return mText;
}
//Mutators
-void C_TextFieldTag::setText(string inText) {
+void C_TextFieldTag::setText(wstring inText) {
mText = inText;
}
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -50,16 +50,16 @@
virtual ~C_TextFieldTag(void);
//Accessors
- string text();
+ wstring text();
//Mutators
- void setText(string inText);
+ void setText(wstring inText);
//Other
- virtual string toString() = 0;
+ virtual wstring toString() = 0;
protected:
//Property Data
- string mText;
+ wstring mText;
//Protected Helper Methods
virtual void privateClone(C_CMMLTag* outTag);
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -43,12 +43,12 @@
{
}
-string C_TitleTag::toString() {
+wstring C_TitleTag::toString() {
//FIX ::: Make this do something
- string retStr = "<title";
- retStr += ">";
+ wstring retStr = L"<title";
+ retStr += L">";
retStr += mText;
- retStr+= "</title>\n";
+ retStr+= L"</title>\n";
return retStr;
}
void C_TitleTag::privateClone(C_CMMLTag* outTag) {
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -50,7 +50,7 @@
virtual ~C_TitleTag(void);
//Other
- virtual string toString();
+ virtual wstring toString();
C_TitleTag* clone();
virtual C_CMMLTag* genericClone();
protected:
Modified: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.cpp 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.cpp 2004-11-30 14:01:28 UTC (rev 8312)
@@ -52,17 +52,17 @@
HRESULT locHR = S_FALSE;
// Check the return value, hr...
locHR = CoCreateInstance(__uuidof(DOMDocument30), NULL, CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument, (void**)outDoc);
- // Check the return value, hr...
+ if (locHR != S_OK) {
+ return false;
+ }
- // Check the return value.
-
BSTR locClipStr = SysAllocString(inText.c_str());
VARIANT_BOOL locBool;
locHR = (*outDoc)->loadXML(locClipStr, &locBool);
- //Should free string ??
SysFreeString(locClipStr);
+
if (locHR == S_OK) {
return true;
} else {
@@ -79,24 +79,24 @@
locHR = inDoc->selectSingleNode(locQuery, &retNode);
+ SysFreeString(locQuery);
- SysFreeString(locQuery);
+ //If the select fails... will return NULL
return retNode;
}
wstring CMMLParser::getNamedAttribValue(wstring inAttribName, MSXML2::IXMLDOMNamedNodeMap* inAttribMap) {
- BSTR locAttribName = SysAllocString(inAttribName.c_str());
- MSXML2::IXMLDOMNode* locAttribNode = NULL;
- wstring retStr = L"";
- HRESULT locHR = S_FALSE;
+ BSTR locAttribName = SysAllocString(inAttribName.c_str());
+ BSTR locBStr = NULL;
+ MSXML2::IXMLDOMNode* locAttribNode = NULL;
+ HRESULT locHR = S_FALSE;
+ wstring retStr = L"";
+
locHR = inAttribMap->getNamedItem(locAttribName, &locAttribNode);
- BSTR locBStr = NULL;
-
+
if (locHR == S_OK) {
locHR = locAttribNode->get_text(&locBStr);
retStr = locBStr;
- } else {
- //Not found... what to do !
}
//Cleanup
@@ -104,28 +104,40 @@
SysFreeString(locBStr);
SysFreeString(locAttribName);
+ //Will return "" on error
return retStr;
}
bool CMMLParser::parseClipTag(MSXML2::IXMLDOMNode* inClipNode, C_ClipTag* outClip) {
+
+ //Required start is not checked for, because CMML in annodex doesn't have one. May need to be
+ // cvalidated elsewhere to be used in CMML documents
MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
MSXML2::IXMLDOMNode* locNode = NULL;
MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
+ BSTR locBStr = NULL;
HRESULT locHR = S_FALSE;
+
wstring locNodeName;
- BSTR locBStr = NULL;
long locNumNodes = 0;
+
+ unsigned long locNum_a = 0;
+ unsigned long locNum_desc = 0;
+ unsigned long locNum_img = 0;
+ unsigned long locNum_meta = 0;
+ unsigned long locNumUnknown = 0;
//---------------Attributes-----------------
//Get the attributes
locHR = inClipNode->get_attributes(&locAttribMap);
- //Other attributes are missing.
- outClip->setId(toNarrowStr(getNamedAttribValue(L"id", locAttribMap)));
- outClip->setStart(toNarrowStr(getNamedAttribValue(L"start", locAttribMap)));
- outClip->setStart(toNarrowStr(getNamedAttribValue(L"end", locAttribMap)));
+ outClip->setId(getNamedAttribValue(L"id", locAttribMap));
+ outClip->setLang(getNamedAttribValue(L"lang", locAttribMap));
+ outClip->setDirn(getNamedAttribValue(L"dir", locAttribMap));
+ outClip->setTrack(getNamedAttribValue(L"track", locAttribMap));
+ outClip->setStart(getNamedAttribValue(L"start", locAttribMap));
+ outClip->setEnd(getNamedAttribValue(L"end", locAttribMap));
//------------------------------------------
-
//--------------Child Nodes-----------------
locHR = inClipNode->get_childNodes(&locChildNodes);
locHR = locChildNodes->get_length(&locNumNodes);
@@ -137,53 +149,119 @@
locNodeName = locBStr;
if (locNodeName == L"a") {
-
+
+ //ZERO OR ONE a elements allowed
C_AnchorTag* locAnchor = new C_AnchorTag;
- parseAnchorTag(locNode, locAnchor);
- outClip->setAnchor(locAnchor);
+ if (parseAnchorTag(locNode, locAnchor)) {
+ outClip->setAnchor(locAnchor);
+ locNum_a++;
+ } else {
+ delete locAnchor;
+ outClip->setAnchor(NULL);
+ }
+
} else if(locNodeName == L"desc") {
-
+
+ //ZERO OR ONE desc elements allowed
C_DescTag* locDesc = new C_DescTag;
- parseDescTag(locNode, locDesc);
- outClip->setDesc(locDesc);
+ if (parseDescTag(locNode, locDesc)) {
+ outClip->setDesc(locDesc);
+ locNum_desc++;
+ } else {
+ delete locDesc;
+ outClip->setDesc(NULL);
+ }
} else if (locNodeName == L"img") {
-
+
+ //ZERO OR ONE img elements allowed
C_ImageTag* locImage = new C_ImageTag;
- parseImageTag(locNode, locImage);
- outClip->setImage(locImage);
+ if (parseImageTag(locNode, locImage)) {
+ outClip->setImage(locImage);
+ locNum_img++;
+ } else {
+ delete locImage;
+ outClip->setImage(locImage);
+ }
} else if (locNodeName == L"meta") {
-
+
+ //ZERO OR *MORE* meta elements allowed
C_MetaTag* locMeta = new C_MetaTag;
- parseMetaTag(locNode, locMeta);
- outClip->metaList()->addTag(locMeta);
+ if (parseMetaTag(locNode, locMeta)) {
+ outClip->metaList()->addTag(locMeta);
+ locNum_meta++;
+ } else {
+ delete locMeta;
+ }
} else {
- //Dunno !
+
+ //TODO::: How to handle ??? For now just ignore tags we don't know.
+ locNumUnknown++;
}
-
-
}
+ bool retVal = (locNum_a <= 1)
+ && (locNum_img <= 1)
+ && (locNum_desc <=1);
+
SysFreeString(locBStr);
if (locAttribMap != NULL) locAttribMap->Release();
if (locNode != NULL) locNode->Release();
if (locChildNodes != NULL) locChildNodes->Release();
- return true;
+ return retVal;
}
+bool CMMLParser::parseClipTag(wstring inClipText, C_ClipTag* outClip) {
+ HRESULT locHR = S_FALSE;
+ MSXML2::IXMLDOMDocument* locXMLClipFrag = NULL;
+ MSXML2::IXMLDOMNode* locClipNode = NULL;
+
+ bool retVal = setupXMLHandles(inClipText, &locXMLClipFrag);
+
+ if (retVal) {
+ locClipNode = getNamedNode(L"clip", locXMLClipFrag);
+
+ if (locClipNode != NULL) {
+ //Now we have a node representing the clip tag and it's children.
+ retVal = parseClipTag(locClipNode, outClip);
+ } else {
+ retVal = false;
+ }
+ }
+
+ if (locXMLClipFrag != NULL) locXMLClipFrag->Release();
+ if (locClipNode != NULL) locClipNode->Release();
+
+ return retVal;
+}
+
+
+
bool CMMLParser::parseHeadTag(MSXML2::IXMLDOMNode* inHeadNode, C_HeadTag* outHead) {
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
- MSXML2::IXMLDOMNode* locNode = NULL;
- HRESULT locHR = S_FALSE;
- long locNumNodes = 0;
- BSTR locBStr = NULL;
- wstring locNodeName;
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
+ MSXML2::IXMLDOMNode* locNode = NULL;
+ HRESULT locHR = S_FALSE;
+ long locNumNodes = 0;
+ BSTR locBStr = NULL;
+ wstring locNodeName;
+
+ unsigned long locNum_title = 0;
+ unsigned long locNum_meta = 0;
+ unsigned long locNum_base = 0;
+ unsigned long locNumUnknown = 0;
+
+
//---------------Attributes-----------------
- //No attributes for now
+ locHR = inHeadNode->get_attributes(&locAttribMap);
+
+ outHead->setId(getNamedAttribValue(L"id", locAttribMap));
+ outHead->setLang(getNamedAttribValue(L"lang", locAttribMap));
+ outHead->setDirn(getNamedAttribValue(L"dir", locAttribMap));
+ outHead->setProfile(getNamedAttribValue(L"profile", locAttribMap));
//------------------------------------------
//--------------Child Nodes-----------------
@@ -192,45 +270,106 @@
for (int i = 0; i < locNumNodes; i++) {
locHR = locChildNodes->get_item(i, &locNode);
locHR = locNode->get_nodeName(&locBStr);
+ //TODO::: Needs checks ??
+
locNodeName = locBStr;
if (locNodeName == L"title") {
+
+ //Must contain ONE title tag
C_TitleTag* locTitle = new C_TitleTag;
- parseTitleTag(locNode, locTitle);
- outHead->setTitle(locTitle);
+
+ if (parseTitleTag(locNode, locTitle)) {
+ outHead->setTitle(locTitle);
+ locNum_title++;
+ } else {
+ delete locTitle;
+ outHead->setTitle(NULL);
+ }
- } else if(locNodeName == L"meta") {
+
+ } else if (locNodeName == L"meta") {
+
+ //Can contain ANY AMOUNT of meta tags
C_MetaTag* locMeta = new C_MetaTag;
- parseMetaTag(locNode, locMeta);
- outHead->metaList()->addTag(locMeta);
+ if (parseMetaTag(locNode, locMeta)) {
+ outHead->metaList()->addTag(locMeta);
+ locNum_meta++;
+ } else {
+ delete locMeta;
+ }
+
+ } else if (locNodeName == L"base") {
+
+ //OPTIONALLY ONE base tag.
+ C_BaseTag* locBase = new C_BaseTag;
+
+ if(parseBaseTag(locNode, locBase)) {
+ outHead->setBase(locBase);
+ locNum_base++;
+ } else {
+ delete locBase;
+ outHead->setBase(NULL);
+ }
+
} else {
- //Dunno !
+ locNumUnknown++;
}
}
+ bool retVal = (locNum_title == 1)
+ && (locNum_base <= 1)
+ && (locNum_meta <= 1);
+
SysFreeString(locBStr);
if (locAttribMap != NULL) locAttribMap->Release();
if (locNode != NULL) locNode->Release();
if (locChildNodes != NULL) locChildNodes->Release();
- return true;
+ return retVal;
}
+bool CMMLParser::parseHeadTag(wstring inHeadText, C_HeadTag* outHead) {
+ HRESULT locHR = S_FALSE;
+ MSXML2::IXMLDOMDocument* locXMLHeadFrag = NULL;
+ MSXML2::IXMLDOMNode* locHeadNode = NULL;
+
+ bool retVal = setupXMLHandles(inHeadText, &locXMLHeadFrag);
+
+ if (retVal) {
+ locHeadNode = getNamedNode(L"head", locXMLHeadFrag);
+ if (locHeadNode != NULL) {
+
+ //Now we have a node representing the clip tag and it's children.
+ retVal = parseHeadTag(locHeadNode, outHead);
+ } else {
+ retVal = false;
+ }
+ }
+
+ if (locXMLHeadFrag != NULL) locXMLHeadFrag->Release();
+ if (locHeadNode != NULL) locHeadNode->Release();
+
+ return retVal;
+}
+
bool CMMLParser::parseStreamTag(MSXML2::IXMLDOMNode* inStreamNode, C_StreamTag* outStream) {
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- MSXML2::IXMLDOMNode* locNode = NULL;
- MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
- HRESULT locHR = S_FALSE;
- long locNumNodes = 0;
- BSTR locBStr = NULL;
- wstring locNodeName;
+ ////-------------Initialisation-------------
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ MSXML2::IXMLDOMNode* locNode = NULL;
+ MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
+ HRESULT locHR = S_FALSE;
+ long locNumNodes = 0;
+ BSTR locBStr = NULL;
+ wstring locNodeName = L"";
+
//---------------Attributes-----------------
- //Get the attributes
locHR = inStreamNode->get_attributes(&locAttribMap);
-
- //Other attributes are missing.
- outStream->setTimebase(toNarrowStr(getNamedAttribValue(L"timebase", locAttribMap)));
+ //outStream->setLang(getNamedAttribValue(L"lang", locAttribMap));
+ //outStream->setDirn(getNamedAttribValue(L"dir", locAttribMap));
+ outStream->setId(getNamedAttribValue(L"id", locAttribMap));
+ outStream->setTimebase(getNamedAttribValue(L"timebase", locAttribMap));
+ outStream->setUtc(getNamedAttribValue(L"utc", locAttribMap));
//------------------------------------------
-
//--------------Child Nodes-----------------
locHR = inStreamNode->get_childNodes(&locChildNodes);
locHR = locChildNodes->get_length(&locNumNodes);
@@ -239,48 +378,96 @@
locHR = locNode->get_nodeName(&locBStr);
locNodeName = locBStr;
if(locNodeName == L"import") {
+
C_ImportTag* locImport = new C_ImportTag;
- parseImportTag(locNode, locImport);
- outStream->importList()->addTag(locImport);
+ if (parseImportTag(locNode, locImport)) {
+ outStream->importList()->addTag(locImport);
+ } else {
+ //TODO::: Anything ???
+ }
} else {
- //Dunno !
+ //TODO::: Handle this, otherwise ignore.
}
}
+ //--------------Clean Up--------------------
SysFreeString(locBStr);
- if (locAttribMap != NULL) locAttribMap->Release();
- if (locNode != NULL) locNode->Release();
- if (locChildNodes != NULL) locChildNodes->Release();
+ if (locAttribMap != NULL) locAttribMap->Release();
+ if (locNode != NULL) locNode->Release();
+ if (locChildNodes != NULL) locChildNodes->Release();
return true;
}
bool CMMLParser::parseImportTag(MSXML2::IXMLDOMNode* inImportNode, C_ImportTag* outImport) {
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- //MSXML2::IXMLDOMNode* locImportNode = NULL;
- HRESULT locHR = S_FALSE;
+ //TODO::: Stream and import tags need checking about what to do with internationalisation
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ MSXML2::IXMLDOMNode* locNode = NULL;
+ MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
+ HRESULT locHR = S_FALSE;
+ long locNumNodes = 0;
+ BSTR locBStr = NULL;
+ wstring locNodeName = L"";
+
+ bool retVal = true;
+
//---------------Attributes-----------------
locHR = inImportNode->get_attributes(&locAttribMap);
- outImport->setId(toNarrowStr(getNamedAttribValue(L"id", locAttribMap)));
- outImport->setContentType(toNarrowStr(getNamedAttribValue(L"contenttype", locAttribMap)));
- outImport->setSrc(toNarrowStr(getNamedAttribValue(L"src", locAttribMap)));
- outImport->setStart(toNarrowStr(getNamedAttribValue(L"start", locAttribMap)));
- outImport->setEnd(toNarrowStr(getNamedAttribValue(L"end", locAttribMap)));
- outImport->setTitle(toNarrowStr(getNamedAttribValue(L"title", locAttribMap)));
- outImport->setGranuleRate(toNarrowStr(getNamedAttribValue(L"granulerate", locAttribMap)));
+
+ outImport->setId(getNamedAttribValue(L"id", locAttribMap));
+ outImport->setContentType(getNamedAttribValue(L"contenttype", locAttribMap));
+ outImport->setSrc(getNamedAttribValue(L"src", locAttribMap));
+ if (outImport->src() == L"") {
+ //Source is required.
+ retVal = false;
+ }
+ outImport->setStart(getNamedAttribValue(L"start", locAttribMap));
+ outImport->setEnd(getNamedAttribValue(L"end", locAttribMap));
+ outImport->setTitle(getNamedAttribValue(L"title", locAttribMap));
+ outImport->setGranuleRate(getNamedAttribValue(L"granulerate", locAttribMap));
//------------------------------------------
- return true;
+
+
+ locHR = inImportNode->get_childNodes(&locChildNodes);
+ locHR = locChildNodes->get_length(&locNumNodes);
+ for (int i = 0; i < locNumNodes; i++) {
+ locHR = locChildNodes->get_item(i, &locNode);
+ locHR = locNode->get_nodeName(&locBStr);
+ locNodeName = locBStr;
+ if(locNodeName == L"param") {
+
+ C_ParamTag* locParam = new C_ParamTag;
+ if (parseParamTag(locNode, locParam)) {
+ outImport->paramList()->addTag(locParam);
+ } else {
+ //TODO::: Anything ???
+ }
+
+ } else {
+ //TODO::: Handle this, otherwise ignore.
+ }
+ }
+
+ SysFreeString(locBStr);
+ if (locAttribMap != NULL) locAttribMap->Release();
+ if (locNode != NULL) locNode->Release();
+ if (locChildNodes != NULL) locChildNodes->Release();
+ return retVal;
}
bool CMMLParser::parseImageTag(MSXML2::IXMLDOMNode* inImageNode, C_ImageTag* outImage) {
MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- MSXML2::IXMLDOMNode* locImageNode = NULL;
+ // MSXML2::IXMLDOMNode* locImageNode = NULL;
HRESULT locHR = S_FALSE;
//---------------Attributes-----------------
locHR = inImageNode->get_attributes(&locAttribMap);
- outImage->setSrc(toNarrowStr(getNamedAttribValue(L"src", locAttribMap)));
+ outImage->setId(getNamedAttribValue(L"id", locAttribMap));
+ outImage->setSrc(getNamedAttribValue(L"src", locAttribMap));
+ outImage->setAlt(getNamedAttribValue(L"alt", locAttribMap));
+
+ if (locAttribMap != NULL) locAttribMap->Release();
return true;
}
/*
@@ -300,26 +487,35 @@
MSXML2::IXMLDOMNode* locMetaNode = NULL;
HRESULT locHR = S_FALSE;
+ bool retVal = false;
//---------------Attributes-----------------
locHR = inMetaNode->get_attributes(&locAttribMap);
- outMeta->setName(toNarrowStr(getNamedAttribValue(L"name", locAttribMap)));
- outMeta->setContent(toNarrowStr(getNamedAttribValue(L"content", locAttribMap)));
- outMeta->setScheme(toNarrowStr(getNamedAttribValue(L"scheme", locAttribMap)));
+
+ outMeta->setId(getNamedAttribValue(L"id", locAttribMap));
+ outMeta->setLang(getNamedAttribValue(L"lang", locAttribMap));
+ outMeta->setDirn(getNamedAttribValue(L"dir", locAttribMap));
+ outMeta->setName(getNamedAttribValue(L"name", locAttribMap));
+ if (outMeta->name() == L"") {
+
+ outMeta->setContent(getNamedAttribValue(L"content", locAttribMap));
+ outMeta->setScheme(getNamedAttribValue(L"scheme", locAttribMap));
//------------------------------------------
+
+ if (locAttribMap != NULL) locAttribMap->Release();
return true;
}
-string CMMLParser::toNarrowStr(wstring inString) {
- string retVal;
+//string CMMLParser::toNarrowStr(wstring inString) {
+// string retVal;
+//
+//
+// for (std::wstring::const_iterator i = inString.begin(); i != inString.end(); i++) {
+// retVal.append(1, *i);
+// }
+//
+// return retVal;
+//}
-
- for (std::wstring::const_iterator i = inString.begin(); i != inString.end(); i++) {
- retVal.append(1, *i);
- }
-
- return retVal;
-}
-
bool CMMLParser::parseAnchorTag(MSXML2::IXMLDOMNode* inAnchorNode, C_AnchorTag* outAnchor) {
MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
MSXML2::IXMLDOMNode* locAnchorNode = NULL;
@@ -329,13 +525,13 @@
//---------------Attributes-----------------
locHR = inAnchorNode->get_attributes(&locAttribMap);
- outAnchor->setHref(toNarrowStr(getNamedAttribValue(L"href", locAttribMap)));
+ outAnchor->setHref(getNamedAttribValue(L"href", locAttribMap));
//------------------------------------------
//Anchor text
inAnchorNode->get_text(&locBStr);
locAnchorText = locBStr;
- outAnchor->setText(toNarrowStr(locAnchorText));
+ outAnchor->setText(locAnchorText);
//Cleanup
SysFreeString(locBStr);
@@ -356,7 +552,7 @@
//------------------------------------------
inTitleNode->get_text(&locBStr);
locTitleText = locBStr;
- outTitle->setText(toNarrowStr(locTitleText));
+ outTitle->setText(locTitleText);
SysFreeString(locBStr);
if (locAttribMap != NULL) locAttribMap->Release();
@@ -377,56 +573,10 @@
//------------------------------------------
inDescNode->get_text(&locBStr);
locDescText = locBStr;
- outDesc->setText(toNarrowStr(locDescText));
+ outDesc->setText(locDescText);
SysFreeString(locBStr);
if (locAttribMap != NULL) locAttribMap->Release();
return true;
}
-bool CMMLParser::parseClipTag(wstring inClipText, C_ClipTag* outClip) {
- HRESULT locHR = S_FALSE;
- MSXML2::IXMLDOMDocument* locXMLClipFrag = NULL;
- MSXML2::IXMLDOMNode* locClipNode = NULL;
-
- bool locSetupOK = setupXMLHandles(inClipText, &locXMLClipFrag);
- //Validate
- if (locSetupOK) {
- //locXMLClipFrag->selectSingleNode(locBStr, &locClipNode);
- locClipNode = getNamedNode(L"clip", locXMLClipFrag);
- //Check return
-
- //Now we have a node representing the clip tag and it's children.
-
- bool retVal = parseClipTag(locClipNode, outClip);
-
- if (locXMLClipFrag != NULL) locXMLClipFrag->Release();
- if (locClipNode != NULL) locClipNode->Release();
-
- return retVal;
- } else {
- return false;
- }
-}
-
-bool CMMLParser::parseHeadTag(wstring inHeadText, C_HeadTag* outHead) {
- HRESULT locHR = S_FALSE;
- MSXML2::IXMLDOMDocument* locXMLHeadFrag = NULL;
- MSXML2::IXMLDOMNode* locHeadNode = NULL;
-
- bool retVal = setupXMLHandles(inHeadText, &locXMLHeadFrag);
-
- if (retVal) {
- locHeadNode = getNamedNode(L"head", locXMLHeadFrag);
- if (locHeadNode != NULL) {
-
- //Now we have a node representing the clip tag and it's children.
- retVal = parseHeadTag(locHeadNode, outHead);
- }
- }
-
- if (locXMLHeadFrag != NULL) locXMLHeadFrag->Release();
- if (locHeadNode != NULL) locHeadNode->Release();
-
- return retVal;
-}
\ No newline at end of file
Modified: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.h 2004-11-30 11:03:04 UTC (rev 8311)
+++ trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.h 2004-11-30 14:01:28 UTC (rev 8312)
@@ -66,7 +66,7 @@
protected:
wstring getNamedAttribValue(wstring inAttribName, MSXML2::IXMLDOMNamedNodeMap* inAttribMap);
MSXML2::IXMLDOMNode* getNamedNode(wstring inXPath, MSXML2::IXMLDOMDocument* inDoc);
- string toNarrowStr(wstring inString);
+ //string toNarrowStr(wstring inString);
//void createTagMap();
//unsigned long hashFunction(string inTagName);
More information about the commits
mailing list