Пример #1
0
bool NGMainWnd::onnet_files(const string &path, const vector<string> &files, const vector<dword> &types, const vector<dword> &sizes) {
	HTREEITEM hparent = NULL;

	// find the parent treenode in the path list
	for (dword i = 0; i < browsenodes.size(); i++) {
		if (browsenodes[i].path.compare(path) == 0) {
			// append new files
			browsenodes[i].files.clear();
			for (dword j = 0; j < files.size(); j++) {
				browsenodes[i].files.push_back(FileItem(files[j], types[j], sizes[j]));
			}
			browsenodes[i].filesloaded = true;

			// refresh files ?
			if (TreeView_GetSelection(this->hbrowsewnd) == browsenodes[i].hnode) {
				listview_setfiles(browsenodes[i].files);
			}
			break;
		}
	}
	return true;
}
Пример #2
0
static  void    GetItem( void ) {
//===============================

    IOKW        kw;

    kw = RecIOKW();
    if( Permission( kw ) ) {
        AdvanceITPtr();
        ReqEquSign();
        switch( kw ) {
          case IO_ACCESS:
              CharItem( FC_SET_ACC );
              break;
          case IO_ACTION:
              CharItem( FC_SET_ACTION );
              break;
          case IO_BLANK:
              CharItem( FC_SET_BLNK );
              break;
          case IO_BLOCKSIZE:
              BlockSize();
              break;
          case IO_CARRIAGECONTROL:
              CharItem( FC_SET_CCTRL );
              break;
          case IO_DIRECT:
              CharItem( FC_SET_DIR );
              break;
          case IO_END:
              LabelItem( FC_SET_END );
              break;
          case IO_ERR:
              LabelItem( FC_SET_ERR );
              break;
          case IO_EXIST:
              BoolInq( FC_SET_EXST );
              break;
          case IO_FILE:
              FileItem();
              break;
          case IO_FMT:
              FormatIdd();
              break;
          case IO_FORM:
              CharItem( FC_SET_FORM );
              break;
          case IO_FMTTED:
              CharItem( FC_SET_FMTD );
              break;
          case IO_IOSTAT:
              IntInq( FC_SET_IOS );
              break;
          case IO_NAME:
              CharItem( FC_SET_NAME );
              break;
          case IO_NAMED:
              BoolInq( FC_SET_NMD );
              break;
          case IO_NXTREC:
              IntInq( FC_SET_NREC );
              break;
          case IO_NUMBER:
              IntInq( FC_SET_NUMB );
              break;
          case IO_OPENED:
              BoolInq( FC_SET_OPEN );
              break;
          case IO_REC:
              IntItem( FC_SET_REC );
              break;
          case IO_RECL:
              Recl();
              break;
          case IO_RECORDTYPE:
              CharItem( FC_SET_RECTYPE );
              break;
          case IO_SEQ:
              CharItem( FC_SET_SEQ );
              break;
          case IO_SHARE:
              CharItem( FC_SET_SHARE );
              break;
          case IO_STATUS:
              CharItem( FC_SET_STAT );
              break;
          case IO_UNFMTD:
              CharItem( FC_SET_UFMTD );
              break;
          case IO_UNIT:
              Unit();
              break;
        }
        AdvanceITPtr();
    } else {
        NextComma();
    }
}
bool FAssetStreamer::StreamPackage(const FString& PakFileName, IAssetStreamerListener* AssetStreamerListener, EAssetStreamingMode::Type DesiredMode, const TCHAR* CmdLine)
{
    Lock();
    Listener = NULL;

    const bool bRemote = (DesiredMode == EAssetStreamingMode::Remote);
    if (!(bRemote && UseRemote(CmdLine) || !bRemote && UseLocal(CmdLine)))
    {
        Unlock();
        return false;
    }
    CurrentMode = DesiredMode;
    FPlatformFileManager::Get().SetPlatformFile(*PakPlatform);

    // Now Get the path and start the streaming
    const FString FilePath = bRemote ? ResolveRemotePath(PakFileName) : ResolveLocalPath(PakFileName);

    // Make sure the Pak file is actually there
    FPakFile PakFile(*FilePath, bSigned);
    if (!PakFile.IsValid())
    {
        Unlock();
        UE_LOG(LogAsyncPackageStreamer, Error, TEXT("Invalid pak file: %s"), *FilePath);
        return false;
    }

    // TODO: Do we need to mount it into the engine dir? Creare a DLC dir instead?
    PakFile.SetMountPoint(*FPaths::EngineContentDir());
    const int32 PakOrder = 0;
    if (!PakPlatform->Mount(*FilePath, PakOrder, *FPaths::EngineContentDir()))
    {
        Unlock();
        UE_LOG(LogAsyncPackageStreamer, Error, TEXT("Failed to mount pak file: %s"), *FilePath);
        return false;
    }

    // Load all assets contained in this Pak file
    TSet<FString> FileList;
    PakFile.FindFilesAtPath(FileList, *PakFile.GetMountPoint(), true, false, true);

    // Discover assets within the PakFile
    StreamedAssets.Empty();
    for (TSet<FString>::TConstIterator FileItem(FileList); FileItem; ++FileItem)
    {
        FString AssetName = *FileItem;
        if (AssetName.EndsWith(FPackageName::GetAssetPackageExtension()) ||
            AssetName.EndsWith(FPackageName::GetMapPackageExtension()))
        {
            // TODO: Set path relative to mountpoint for remote streaming?
            StreamedAssets.Add(AssetName);
        }
    }

    // Once we started the async work assign listener
    Listener = AssetStreamerListener;

    // Tell the listener which assets we are about to stream
    if (Listener)
    {
        Listener->OnPrepareAssetStreaming(StreamedAssets);
    }

    // IF we have not yet a StreamableManager setup (Arrr...) abort
    if (StreamableManager == nullptr)
    {
        Unlock();
        UE_LOG(LogAsyncPackageStreamer, Error, TEXT("No StreamableManager registered, did you missed to call initialize?"));
        return false;
    }

    StreamableManager->RequestAsyncLoad(StreamedAssets, FStreamableDelegate::CreateRaw(this, &FAssetStreamer::OnStreamingCompleteDelegate));
    return true;
}