void PowerPointSchemaSoftDiscoverStrategy::Execute(EshObject& in_parent)
{
   try
   {
      ChLOG_DEBUG_START_FN;
      PptObjectFactory &factory = m_pReader->getObjectFactory();

      ChUINT4 ulNumChildren = in_parent.getNumChildren();
		m_numberOfChildren = ulNumChildren;
      for(ChUINT4 i = 0; i < ulNumChildren; ++i)
      {
         ChUINT2 unType = in_parent.getChildType(i);
         ChUINT2 unVersion = in_parent.getChildVersion(i);

         ChAutoPtr<EshObject> pObject = factory.createObject(unType, unVersion);

         if(0 != pObject.get())
         {
            if(ESH_OBJ_ROOT == pObject->getType())
               ProcessRootObject(*pObject);
            else if(pObject->isSemanticEscher())
               ProcessSemanticEscher(*pObject);
            else if(pObject->isAtom())
               m_currentState->Handle(*this, *pObject);
            else if(pObject->isContainer())
               ProcessContainer(*pObject);
            else
               ChASSERT(false);
         }
      }
   }
   catch(CsException const& e)
   {
      TCHAR buffer[255];
      ::wsprintf(buffer, _T("Binary Document Library threw an exception type: %d"), e.getType());
		LOG_WS_ERROR(buffer);
   }
}
示例#2
0
UPnpCDSExtensionResults *UPnpCDSExtension::Browse( UPnpCDSRequest *pRequest )
{
    // -=>TODO: Need to add Filter & Sorting Support.
    // -=>TODO: Need to add Sub-Folder/Category Support!!!!!

    if (!IsBrowseRequestForUs( pRequest ))
        return( NULL );

    // ----------------------------------------------------------------------
    // Parse out request object's path
    // ----------------------------------------------------------------------

    QStringList idPath = QStringList::split( "/", pRequest->m_sObjectId.section('=',0,0) );

    QString key = pRequest->m_sObjectId.section('=',1);

    if (idPath.count() == 0)
        return( NULL );

    // ----------------------------------------------------------------------
    // Process based on location in hierarchy
    // ----------------------------------------------------------------------

    UPnpCDSExtensionResults *pResults = new UPnpCDSExtensionResults();

    if (pResults != NULL)
    {

        if (key)
            idPath.last().append(QString("=%1").arg(key));
        else
        {
            if (pRequest->m_sObjectId.contains("item"))
            {
                idPath = QStringList::split( " ", idPath[idPath.count() - 2] );
                idPath = QStringList::split( "?", idPath[0] );

                idPath = idPath[0];

                if (idPath[0].startsWith("Id"))
                    idPath[0] = QString("item=%1").arg(idPath[0].right(idPath[0].length() - 2));
            }
        }

        QString sLast = idPath.last();

        pRequest->m_sParentId = pRequest->m_sObjectId;

        if (sLast == m_sExtensionId         ) { return( ProcessRoot   ( pRequest, pResults, idPath )); }
        if (sLast == "0"                    ) { return( ProcessAll    ( pRequest, pResults, idPath )); }
        if (sLast.startsWith( "key" , true )) { return( ProcessKey    ( pRequest, pResults, idPath )); }
        if (sLast.startsWith( "item", true )) { return( ProcessItem   ( pRequest, pResults, idPath )); }

        int nNodeIdx = sLast.toInt();

        if ((nNodeIdx > 0) && (nNodeIdx < GetRootCount()))
            return( ProcessContainer( pRequest, pResults, nNodeIdx, idPath ));

        pResults->m_eErrorCode = UPnPResult_CDS_NoSuchObject;
        pResults->m_sErrorDesc = "";
    }

    return( pResults );
}
示例#3
0
文件: file_manager.cpp 项目: egils/OS
void File::add_process_to_waiting_queue(u64int process_id, FILE_MODE mode) {

  this->process_queue.push_back(ProcessContainer(process_id, mode));
  this->file_manager->block_process(process_id);

  }