|
#include "StdAfx.h"
#include "CData.h"
using namespace Elmax;
CData::CData(void)
: m_ptrCData(NULL)
{
}
CData::~CData(void)
{
}
std::wstring CData::GetContent() const
{
if(!m_ptrCData)
throw std::exception("Invalid CData object");
std::wstring data = (LPCWSTR)(m_ptrCData->data);
return data;
}
long CData::GetLength() const
{
if(!m_ptrCData)
throw std::exception("Invalid CData object");
return m_ptrCData->length;
}
bool CData::Delete()
{
if(!m_ptrCData)
throw std::exception("Invalid CData object");
MSXML2::IXMLDOMNodePtr parent = m_ptrCData->GetparentNode();
if(parent)
{
m_ptrCData = parent->removeChild(m_ptrCData);
}
else
return false;
return true;
}
bool CData::Update(const std::wstring& data)
{
if(!m_ptrCData)
throw std::exception("Invalid CData object");
HRESULT hr = m_ptrCData->replaceData(0, data.length(), data.c_str());
return SUCCEEDED(hr);
}
bool CData::IsValid()
{
if(!m_ptrCData)
return false;
return true;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Shao Voon is from Singapore. His interest lies primarily in computer graphics, software optimization, concurrency, security, and Agile methodologies.
In recent years, he shifted focus to software safety research. His hobby is writing a free C++ DirectX photo slideshow application which can be viewed
here.