const Token* AttributesParser::parseComplexAttribute(const Token* pNext, const std::string& id) { poco_assert_dbg (isOperator(pNext, OperatorToken::OP_OPENBRACE)); pNext = next(); std::string oldId(_id); if (!_id.empty()) { _id.append("."); _id.append(id); } else _id = id; pNext = parseAttributes(pNext); _id = oldId; if (isOperator(pNext, OperatorToken::OP_CLOSBRACE)) pNext = next(); else throw SyntaxException("bad attribute declaration"); return pNext; }
bool SqlRegistry::updateCachedUrl( const QString &oldUrl, const QString &newUrl ) { int deviceId = m_collection->mountPointManager()->getIdForUrl( oldUrl ); QString rpath = m_collection->mountPointManager()->getRelativePath( deviceId, oldUrl ); TrackPath oldId( deviceId, rpath ); int newdeviceId = m_collection->mountPointManager()->getIdForUrl( newUrl ); QString newRpath = m_collection->mountPointManager()->getRelativePath( newdeviceId, newUrl ); TrackPath newId( newdeviceId, newRpath ); QMutexLocker locker( &m_trackMutex ); if( m_trackMap.contains( newId ) ) warning() << "updating path to an already existing path."; else if( !m_trackMap.contains( oldId ) ) warning() << "updating path from a non existing path."; else { Meta::TrackPtr track = m_trackMap.take( oldId ); m_trackMap.insert( newId, track ); return true; } return false; }