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

📄 dom_node_generic.h

📁 这是一款2d游戏引擎
💻 H
字号:
/*  $Id: dom_node_generic.h,v 1.8 2003/12/22 16:51:44 mbn Exp $
**
**  ClanLib Game SDK
**  Copyright (C) 2003  The ClanLib Team
**  For a total list of contributers see the file CREDITS.
**
**  This library is free software; you can redistribute it and/or
**  modify it under the terms of the GNU Lesser General Public
**  License as published by the Free Software Foundation; either
**  version 2.1 of the License, or (at your option) any later version.
**
**  This library is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
**  Lesser General Public License for more details.
**
**  You should have received a copy of the GNU Lesser General Public
**  License along with this library; if not, write to the Free Software
**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
*/

#ifndef header_dom_node_generic
#define header_dom_node_generic

#if _MSC_VER > 1000
#pragma once
#endif

#include <map>
#include <string>

class CL_DomDocument_Generic;

class CL_DomNode_Generic
{
//! Construction:
public:
	CL_DomNode_Generic() : parent(0),
		first_child(0), last_child(0),
		previous_sibling(0), next_sibling(0),
		owner_document(0), ref_count(0)
	{
	}

	virtual ~CL_DomNode_Generic()
	{
		CL_DomNode_Generic *next = first_child;
		while (next)
		{
			CL_DomNode_Generic *cur = next;
			next = cur->next_sibling;
			cur->release_ref();
		}

		for(int i = 0; i < (int)attributes.size(); ++i)
			attributes[i].second->release_ref();
	}

//! Attributes:
public:
	std::string node_name;

	std::string node_value;

	unsigned short node_type;

	CL_DomNode_Generic *parent;

	CL_DomNode_Generic *first_child;

	CL_DomNode_Generic *last_child;

	CL_DomNode_Generic *previous_sibling;

	CL_DomNode_Generic *next_sibling;

	CL_DomDocument_Generic *owner_document;

	std::vector<std::pair<std::string, CL_DomNode_Generic *> > attributes;

//! Operations:
public:
	void add_ref() { ref_count++; }

	void release_ref() { if (--ref_count == 0) delete this; }

//! Implementation:
private:
	int ref_count;
};

#endif

⌨️ 快捷键说明

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