Commit 68dd0061 authored by hybrid's avatar hybrid

Make some methods const

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3401 dfc29bdd-3216-0410-991c-e03cc46cb475
parent c11c87f2
......@@ -67,7 +67,7 @@ public:
virtual bool existsAttribute(const c8* attributeName) = 0;
//! Returns attribute index from name, -1 if not found
virtual s32 findAttribute(const c8* attributeName) = 0;
virtual s32 findAttribute(const c8* attributeName) const =0;
//! Removes all attributes
virtual void clear() = 0;
......@@ -102,11 +102,11 @@ public:
//! Gets an attribute as integer value
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual s32 getAttributeAsInt(const c8* attributeName) = 0;
virtual s32 getAttributeAsInt(const c8* attributeName) const =0;
//! Gets an attribute as integer value
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual s32 getAttributeAsInt(s32 index) = 0;
virtual s32 getAttributeAsInt(s32 index) const =0;
//! Sets an attribute as integer value
virtual void setAttribute(s32 index, s32 value) = 0;
......
......@@ -230,7 +230,7 @@ void CAttributes::setAttribute(s32 index, const core::array<core::stringw>& valu
//! Returns attribute index from name, -1 if not found
s32 CAttributes::findAttribute(const c8* attributeName)
s32 CAttributes::findAttribute(const c8* attributeName) const
{
for (u32 i=0; i<Attributes.size(); ++i)
if (Attributes[i]->Name == attributeName)
......@@ -240,7 +240,7 @@ s32 CAttributes::findAttribute(const c8* attributeName)
}
IAttribute* CAttributes::getAttributeP(const c8* attributeName)
IAttribute* CAttributes::getAttributeP(const c8* attributeName) const
{
for (u32 i=0; i<Attributes.size(); ++i)
if (Attributes[i]->Name == attributeName)
......@@ -294,7 +294,7 @@ void CAttributes::setAttribute(const c8* attributeName, s32 value)
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute() as integer
//! or 0 if attribute is not set.
s32 CAttributes::getAttributeAsInt(const c8* attributeName)
s32 CAttributes::getAttributeAsInt(const c8* attributeName) const
{
IAttribute* att = getAttributeP(attributeName);
if (att)
......@@ -614,7 +614,7 @@ bool CAttributes::getAttributeAsBool(s32 index)
//! Gets an attribute as integer value
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
s32 CAttributes::getAttributeAsInt(s32 index)
s32 CAttributes::getAttributeAsInt(s32 index) const
{
if ((u32)index < Attributes.size())
return Attributes[index]->getInt();
......
......@@ -54,7 +54,7 @@ public:
virtual bool existsAttribute(const c8* attributeName);
//! Returns attribute index from name, -1 if not found
virtual s32 findAttribute(const c8* attributeName);
virtual s32 findAttribute(const c8* attributeName) const;
//! Removes all attributes
virtual void clear();
......@@ -84,11 +84,11 @@ public:
//! Gets an attribute as integer value
//! \param attributeName: Name of the attribute to get.
//! \return Returns value of the attribute previously set by setAttribute()
virtual s32 getAttributeAsInt(const c8* attributeName);
virtual s32 getAttributeAsInt(const c8* attributeName) const;
//! Gets an attribute as integer value
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
virtual s32 getAttributeAsInt(s32 index);
virtual s32 getAttributeAsInt(s32 index) const;
//! Sets an attribute as integer value
virtual void setAttribute(s32 index, s32 value);
......@@ -649,7 +649,7 @@ protected:
core::array<IAttribute*> Attributes;
IAttribute* getAttributeP(const c8* attributeName);
IAttribute* getAttributeP(const c8* attributeName) const;
video::IVideoDriver* Driver;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment