예제 #1
0
파일: UmlItem.cpp 프로젝트: javrillon/douml
void UmlItem::manage_alias(const char *& p, QTextStream & ts)
{
    // p starts by '@'
    const char * pclosed;

    if ((p[1] == '{') && ((pclosed = strchr(p + 2, '}')) != 0)) {
        QByteArray key_(p + 2, pclosed - p - 1);
        WrapperStr key = key_;
        WrapperStr value;
        UmlItem * node = this;

        do {
            if (node->propertyValue(key, value))
                break;

            node = node->parent();
        }
        while (node != 0);

        if (node != 0)
            // find, insert the value
            ts << value;
        else
            // not find, insert the key
            ts << "@{" << key << '}';

        // bypass the key
        p += strlen(key) + 3;
    }
    else
        // bypass '$'
        ts << toLocale(p);
}
예제 #2
0
//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
void ServerImplemented::Regist( const EFK_CHAR* key, Effect* effect )
{
	if( effect == NULL ) return;

	std::wstring key_( (const wchar_t*)key );

	if( m_effects.count( key_ ) > 0 )
	{
		m_effects[key_]->Release();
	}

	m_effects[key_] = effect;
	m_effects[key_]->AddRef();

	if( m_data.count( key_ ) > 0 )
	{
		if( m_materialPath.size() > 1 )
		{
			m_effects[key_]->Reload( &(m_data[key_][0]), m_data.size(), &(m_materialPath[0]) );
		}
		else
		{
			m_effects[key_]->Reload( &(m_data[key_][0]), m_data.size() );
		}
	}
}