⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winreg.cpp

📁 著名的 helix realplayer 基于手机 symbian 系统的 播放器全套源代码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
/* ***** BEGIN LICENSE BLOCK ***** 
 * Version: RCSL 1.0/RPSL 1.0 
 *  
 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
 *      
 * The contents of this file, and the files included with this file, are 
 * subject to the current version of the RealNetworks Public Source License 
 * Version 1.0 (the "RPSL") available at 
 * http://www.helixcommunity.org/content/rpsl unless you have licensed 
 * the file under the RealNetworks Community Source License Version 1.0 
 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
 * in which case the RCSL will apply. You may also obtain the license terms 
 * directly from RealNetworks.  You may not use this file except in 
 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
 * applicable to this file, the RCSL.  Please see the applicable RPSL or 
 * RCSL for the rights, obligations and limitations governing use of the 
 * contents of the file.  
 *  
 * This file is part of the Helix DNA Technology. RealNetworks is the 
 * developer of the Original Code and owns the copyrights in the portions 
 * it created. 
 *  
 * This file, and the files included with this file, is distributed and made 
 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
 * 
 * Technology Compatibility Kit Test Suite(s) Location: 
 *    http://www.helixcommunity.org/content/tck 
 * 
 * Contributor(s): 
 *  
 * ***** END LICENSE BLOCK ***** */ 

#include "hxcom.h"
#include "hxresult.h"
#include "hxstring.h"
#include "hxwinreg.h"

#include "hxheap.h"
#ifdef _DEBUG
#undef HX_THIS_FILE		
static const char HX_THIS_FILE[] = __FILE__;
#endif

_CListOfCHXString_Node::_CListOfCHXString_Node()
  : m_plocPrev(NULL)
  , m_plocNext(NULL)
{
}

_CListOfCHXString_Node::~_CListOfCHXString_Node()
{
    Remove();
}

void
_CListOfCHXString_Node::Remove()
{
    if(m_plocPrev)
    {
	m_plocPrev->next(m_plocNext);
    }

    if(m_plocNext)
    {
	m_plocNext->prev(m_plocPrev);
    }
}

void
_CListOfCHXString_Node::Insert(_CListOfCHXString_Node& rlocnNew)
{
    rlocnNew.next(this);
    rlocnNew.prev(m_plocPrev);

    if(m_plocPrev)
    {
	m_plocPrev->next(&rlocnNew);
    }
	
    m_plocPrev = &rlocnNew;
}

CHXString&
_CListOfCHXString_Node::value()
{
    return m_clsValue;
}

const CHXString&
_CListOfCHXString_Node::value() const
{
    return m_clsValue;
}

void
_CListOfCHXString_Node::value(const CHXString& rclsNewValue)
{
    m_clsValue = rclsNewValue;
}

_CListOfCHXString_Node&
_CListOfCHXString_Node::operator=(const CHXString& rclsNewValue)
{
    m_clsValue = rclsNewValue;
    return *this;
}

_CListOfCHXString_Node*
_CListOfCHXString_Node::next() const
{
    return m_plocNext;
}

void
_CListOfCHXString_Node::next(_CListOfCHXString_Node* plocnNew)
{
    m_plocNext = plocnNew;
}

_CListOfCHXString_Node*
_CListOfCHXString_Node::prev() const
{
    return m_plocPrev;
}

void
_CListOfCHXString_Node::prev(_CListOfCHXString_Node* plocnNew)
{
    m_plocPrev = plocnNew;
}

_CListOfCHXString_::_CListOfCHXString_()
{
    m_locnREnd.next(&m_locnEnd);
    m_locnEnd.prev(&m_locnREnd);
}

_CListOfCHXString_::_CListOfCHXString_(const _CListOfCHXString_& rlocOther)
{
    m_locnREnd.next(&m_locnEnd);
    m_locnEnd.prev(&m_locnREnd);

    _copy(rlocOther);
}

_CListOfCHXString_::~_CListOfCHXString_()
{
    empty();
}

_CListOfCHXString_&
_CListOfCHXString_::operator=(const _CListOfCHXString_& rlocOther)
{
    empty();
    _copy(rlocOther);

    return *this;
}

void
_CListOfCHXString_::_copy(const _CListOfCHXString_& rlocOther)
{
    iterator itOther;
			
    for
    (
	itOther = rlocOther.begin();
	itOther != rlocOther.end();
	++itOther
    )
    {
	insert(end(), *itOther);
    }
}

_CListOfCHXString_::iterator
_CListOfCHXString_::begin()
{
    return iterator(*(m_locnREnd.next()));
}

const _CListOfCHXString_::iterator
_CListOfCHXString_::begin() const
{
    return iterator(*(m_locnREnd.next()));
}

_CListOfCHXString_::iterator
_CListOfCHXString_::end()
{
    return iterator(m_locnEnd);
}

const _CListOfCHXString_::iterator
_CListOfCHXString_::end() const
{
    return iterator(m_locnEnd);
}

_CListOfCHXString_::reverse_iterator
_CListOfCHXString_::rbegin()
{
    return reverse_iterator(*(m_locnEnd.prev()));
}

const _CListOfCHXString_::reverse_iterator 
_CListOfCHXString_::rbegin() const
{
    return const_reverse_iterator(*(m_locnEnd.prev()));
}

_CListOfCHXString_::reverse_iterator
_CListOfCHXString_::rend()
{
    return reverse_iterator(m_locnREnd);
}

const _CListOfCHXString_::reverse_iterator
_CListOfCHXString_::rend() const
{
    return const_reverse_iterator(*((const _CListOfCHXString_Node *)&m_locnREnd));
}

_CListOfCHXString_::iterator
_CListOfCHXString_::insert(iterator itBefore, const CHXString& rclsNew)
{
    _CListOfCHXString_Node* plocnNew = new _CListOfCHXString_Node;

    HX_ASSERT(plocnNew);

    *plocnNew = rclsNew;

    itBefore.m_plocCurrent->Insert(*plocnNew);

    return iterator(*plocnNew);
}

void
_CListOfCHXString_::insert
(
    iterator itBefore,
    const iterator itFirst,
    const iterator itLast
)
{
    iterator itOther;
    _CListOfCHXString_Node* plocnNew;

    for (itOther = itFirst; itOther != itLast; ++itOther)
    {
	plocnNew = new _CListOfCHXString_Node;

	HX_ASSERT(plocnNew);

	*plocnNew = *itOther;

	itBefore.m_plocCurrent->Insert(*plocnNew);
    }
}

void
_CListOfCHXString_::remove(iterator itThis)
{
    if
    (
	itThis.m_plocCurrent == &m_locnEnd ||
	itThis.m_plocCurrent == &m_locnREnd
    )
    {
	return;
    }

    _CListOfCHXString_Node* plocnOld;

    plocnOld = itThis.m_plocCurrent;

    ++itThis;

    plocnOld->Remove();

    delete plocnOld;
}

void
_CListOfCHXString_::remove(iterator itFirst, iterator itLast)
{
    if
    (
	itFirst.m_plocCurrent == &m_locnEnd ||
	itFirst.m_plocCurrent == &m_locnREnd
    )
    {
	return;
    }

    iterator itOther;
    _CListOfCHXString_Node* plocnOld;

    for (itOther = itFirst; itOther != itLast;)
    {
	plocnOld = itOther.m_plocCurrent;

	++itOther;

	plocnOld->Remove();

	delete plocnOld;
    }
}

void
_CListOfCHXString_::empty()
{
    remove(begin(), end());
}

_CListIteratorCHXString_::_CListIteratorCHXString_()
  : m_plocCurrent(NULL)
{
}

_CListIteratorCHXString_::_CListIteratorCHXString_
(
    const _CListOfCHXString_Node& rlocnNewLocation
)
  : m_plocCurrent((_CListOfCHXString_Node*)&rlocnNewLocation)
{
}

_CListIteratorCHXString_::_CListIteratorCHXString_
(
    const _CListIteratorCHXString_& rliocOther
)
  : m_plocCurrent(rliocOther.m_plocCurrent)
{
}

_CListIteratorCHXString_::~_CListIteratorCHXString_()
{
}

_CListIteratorCHXString_&
_CListIteratorCHXString_::operator=
(
    const _CListIteratorCHXString_& rliocOther
)
{
    m_plocCurrent = rliocOther.m_plocCurrent;

    return *this;
}

CHXString&
_CListIteratorCHXString_::operator*()
{
    HX_ASSERT(m_plocCurrent);
    return m_plocCurrent->value();
}

_CListIteratorCHXString_&
_CListIteratorCHXString_::operator=(const CHXString& rclsNewValue)
{
    if(!m_plocCurrent)
	return *this;

    m_plocCurrent->value(rclsNewValue);

    return *this;
}

_CListIteratorCHXString_&
_CListIteratorCHXString_::operator++()
{
    if(!m_plocCurrent)
	return *this;

    m_plocCurrent = m_plocCurrent->next();

    return *this;
}

const _CListIteratorCHXString_
_CListIteratorCHXString_::operator++(int)
{
    _CListIteratorCHXString_ liocRet(*this);

    ++(*this);

    return liocRet;
}

_CListIteratorCHXString_&
_CListIteratorCHXString_::operator--()
{
    if(!m_plocCurrent)
	return *this;

    m_plocCurrent = m_plocCurrent->prev();

    return *this;
}

const _CListIteratorCHXString_
_CListIteratorCHXString_::operator--(int)
{
    _CListIteratorCHXString_ liocRet(*this);

    --(*this);

    return liocRet;
}

BOOL operator==
(
    const _CListIteratorCHXString_& rliocLeft,
    const _CListIteratorCHXString_& rliocRight
)
{
    return (rliocLeft.m_plocCurrent == rliocRight.m_plocCurrent);
}

BOOL operator!=
(
    const _CListIteratorCHXString_& rliocLeft,
    const _CListIteratorCHXString_& rliocRight
)
{
    return (rliocLeft.m_plocCurrent != rliocRight.m_plocCurrent);
}

_CListReverseIteratorCHXString_::_CListReverseIteratorCHXString_()
  : m_plocCurrent(NULL)
{
}

_CListReverseIteratorCHXString_::_CListReverseIteratorCHXString_
(
    const _CListOfCHXString_Node& rlocnNewLocation
)
  : m_plocCurrent((_CListOfCHXString_Node*)&rlocnNewLocation)
{
}

_CListReverseIteratorCHXString_::_CListReverseIteratorCHXString_
(
    _CListReverseIteratorCHXString_& rlriocOther
)
  : m_plocCurrent(rlriocOther.m_plocCurrent)
{
}

_CListReverseIteratorCHXString_::~_CListReverseIteratorCHXString_()
{
}

_CListReverseIteratorCHXString_&
_CListReverseIteratorCHXString_::operator=
(
    const _CListReverseIteratorCHXString_& rlriocOther
)
{
    m_plocCurrent = rlriocOther.m_plocCurrent;
    return *this;
}

CHXString&
_CListReverseIteratorCHXString_::operator*()
{
    HX_ASSERT(m_plocCurrent);
    return m_plocCurrent->value();
}

_CListReverseIteratorCHXString_&
_CListReverseIteratorCHXString_::operator=(const CHXString& rclsNewValue)
{
    if(!m_plocCurrent)
	return *this;

    m_plocCurrent->value(rclsNewValue);

    return *this;
}

_CListReverseIteratorCHXString_&
_CListReverseIteratorCHXString_::operator++()
{
    if(!m_plocCurrent)
	return *this;

    m_plocCurrent = m_plocCurrent->prev();

    return *this;
}

const _CListReverseIteratorCHXString_
_CListReverseIteratorCHXString_::operator++(int)
{
    _CListReverseIteratorCHXString_ lriocRet(*this);

    ++(*this);

    return lriocRet;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -