示例#1
0
Property
Properties::get( const std::string& key ) const
{
    std::string nkey = normalize( key );
    for( Properties::const_iterator i = begin(); i != end(); i++ )
    {
        if ( i->getName() == nkey )
        {
            return *i;
        }
    }
    return Property::invalid();
}
示例#2
0
osg::Vec4
Properties::getVec4Value( const std::string& key ) const
{
    std::string nkey = normalize( key );
    for( Properties::const_iterator i = begin(); i != end(); i++ )
    {
        if ( i->getName() == nkey )
        {
            return i->getVec4Value();
        }
    }
    return osg::Vec4(0,0,0,1);
}
示例#3
0
std::string
Properties::getValue( const std::string& key, std::string def ) const
{
    std::string nkey = normalize( key );
    for( Properties::const_iterator i = begin(); i != end(); i++ )
    {
        if ( i->getName() == nkey )
        {
            return i->getValue();
        }
    }
    return def;
}
示例#4
0
bool
Properties::exists( const std::string& key ) const
{
    std::string nkey = normalize( key );
    for( Properties::const_iterator i = begin(); i != end(); i++ )
    {
        if ( i->getName() == nkey )
        {
            return true;
        }
    }
    return false;
}