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

📄 resourceid.h

📁 java实现的简单的分形树。简单易学!是学习分形知识的很好的例子。其java语法简单
💻 H
字号:
// --------------------------------------------------------------------------
// Dingus project - a collection of subsystems for game/graphics applications
// --------------------------------------------------------------------------

#ifndef __RESOURCE_ID_H
#define __RESOURCE_ID_H

namespace dingus {

/**
 *  Resource identifier.
 *
 *  Resources are identified by CResourceId, which is essentially
 *  a read-only std::string, refering to a file in most cases.
 */
class CResourceId {
public:
	CResourceId( const char *id );
	CResourceId( const std::string& id );
	CResourceId( const CResourceId& rid );

	const std::string& getUniqueName() const;

	const CResourceId& operator=( const CResourceId& rhs );
	
	bool operator== ( const CResourceId& rhs ) const;
	bool operator!= ( const CResourceId& rhs ) const;
	bool operator< ( const CResourceId& rhs ) const;
	
private:
	std::string	mId;
};



// ------------------------------------------------------------------
//  implementation

inline CResourceId::CResourceId( const char* id )
:	mId( id )
{
}
inline CResourceId::CResourceId( const std::string& id )
:	mId( id )
{
}
inline CResourceId::CResourceId( const CResourceId& rid )
:	mId( rid.mId )
{
}
inline const std::string& CResourceId::getUniqueName() const
{
	return mId;
};
inline const CResourceId& CResourceId::operator=( const CResourceId& rhs )
{
	if( this == &rhs )
		return *this;
	mId = rhs.mId;
	return *this;
}
inline bool CResourceId::operator== ( const CResourceId& rhs ) const
{
	if( &rhs == this )
		return true;
	return ( mId == rhs.getUniqueName() );
}
inline bool CResourceId::operator!= ( const CResourceId& rhs ) const
{
	return !( CResourceId::operator==( rhs ) );
}
inline bool CResourceId::operator< ( const CResourceId& rhs ) const
{
	return ( mId < rhs.getUniqueName() );
}



}; // namespace

#endif

⌨️ 快捷键说明

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