コード例 #1
0
ファイル: property.cpp プロジェクト: lozpeng/applesales
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
ファイル: property.cpp プロジェクト: lozpeng/applesales
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
ファイル: property.cpp プロジェクト: lozpeng/applesales
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
ファイル: property.cpp プロジェクト: lozpeng/applesales
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;
}