// ************************************************************************************************************
// Author: Marcin Załęczny
// Release Date: 2010-11-08
// Licence: The GNU Lesser General Public License, version 3.0 (LGPLv3)
// ************************************************************************************************************
#include "mzXpsContentTypes.h"

CXpsContentTypes::CXpsContentTypes()
    : CXmlDocument(L"Types")
{
    this->setRealClassName(L"CXpsContentTypes");
}

CXpsContentTypes::CXpsContentTypes(CString xmlVersion, CString xmlEncoding)
    : CXmlDocument(xmlVersion, xmlEncoding)
{
}

CXpsContentTypes::~CXpsContentTypes() {
}

BOOL CXpsContentTypes::addContentType(CString extension, CString contentType) {
    CXmlNode* item = new CXmlNode(L"Default");
    if (item) {
        item->addAttribute(L"Extension", extension);
        item->addAttribute(L"ContentType", contentType);
        this->_items->append((LONG)item);
        return TRUE;
    }
    
    return FALSE;
}
