/// <summary> /// Construct a key from an archive /// </summary> /// <param name="Reader">Archive to read from</param> public ConfigDependencyKey(BinaryArchiveReader Reader) { Type = (ConfigHierarchyType)Reader.ReadInt(); ProjectDir = Reader.ReadDirectoryReference(); Platform = Reader.ReadUnrealTargetPlatform(); SectionName = Reader.ReadString(); KeyName = Reader.ReadString(); }
/// <summary> /// Read from binary archive /// </summary> public bool ReadDocument(BinaryArchiveReader archive) { var rc = false; if (null != archive) { try { archive.Read3dmChunkVersion(out var major, out var minor); if (major == MAJOR && minor == MINOR) { var count = archive.ReadInt(); for (var i = 0; i < count; i++) { var key = archive.ReadString(); var data = new ModelEntity(); if (data.ReadArchive(archive)) { this.Add(key, data); } } rc = archive.ReadErrorOccured; } } catch { // ignored } } return(rc); }
/// <summary> /// Construct a TargetInfo from an archive on disk /// </summary> /// <param name="Reader">Archive to read from</param> public TargetInfo(BinaryArchiveReader Reader) { this.Name = Reader.ReadString(); this.Platform = UnrealTargetPlatform.Parse(Reader.ReadString()); string ConfigurationStr = Reader.ReadString(); this.Architecture = Reader.ReadString(); this.ProjectFile = Reader.ReadFileReference(); string[] ArgumentStrs = Reader.ReadArray(() => Reader.ReadString()); if (!UnrealTargetConfiguration.TryParse(ConfigurationStr, out Configuration)) { throw new BuildException(string.Format("The configration name {0} is not a valid configration name. Valid names are ({1})", Name, string.Join(",", Enum.GetValues(typeof(UnrealTargetConfiguration)).Cast <UnrealTargetConfiguration>().Select(x => x.ToString())))); } Arguments = new CommandLineArguments(ArgumentStrs); }
/// <summary> /// Read a file item as a DirectoryItem and name. This is slower than reading it directly, but results in a significantly smaller archive /// where most files are in the same directories. /// </summary> /// <param name="Reader">Archive to read from</param> /// <returns>FileItem read from the archive</returns> static FileItem ReadCompactFileItemData(this BinaryArchiveReader Reader) { DirectoryItem Directory = Reader.ReadDirectoryItem(); string Name = Reader.ReadString(); FileItem FileItem = FileItem.GetItemByFileReference(FileReference.Combine(Directory.Location, Name)); FileItem.UpdateCachedDirectory(Directory); return(FileItem); }
public Action(BinaryArchiveReader Reader) { ActionType = (ActionType)Reader.ReadByte(); WorkingDirectory = Reader.ReadDirectoryReference(); bPrintDebugInfo = Reader.ReadBool(); CommandPath = Reader.ReadFileReference(); CommandArguments = Reader.ReadString(); CommandDescription = Reader.ReadString(); StatusDescription = Reader.ReadString(); bCanExecuteRemotely = Reader.ReadBool(); bCanExecuteRemotelyWithSNDBS = Reader.ReadBool(); bIsGCCCompiler = Reader.ReadBool(); bShouldOutputStatusDescription = Reader.ReadBool(); bProducesImportLibrary = Reader.ReadBool(); PrerequisiteItems = Reader.ReadList(() => Reader.ReadFileItem()); ProducedItems = Reader.ReadList(() => Reader.ReadFileItem()); DeleteItems = Reader.ReadList(() => Reader.ReadFileItem()); DependencyListFile = Reader.ReadFileItem(); }
/// <summary> /// Constructor. Reads a makefile from disk. /// </summary> /// <param name="Reader">The archive to read from</param> public TargetMakefile(BinaryArchiveReader Reader) { CreateTimeUtc = new DateTime(Reader.ReadLong(), DateTimeKind.Utc); ToolchainInfo = Reader.ReadString(); ExternalMetadata = Reader.ReadString(); ReceiptFile = Reader.ReadFileReference(); ProjectIntermediateDirectory = Reader.ReadDirectoryReference(); TargetType = (TargetType)Reader.ReadInt(); bDeployAfterCompile = Reader.ReadBool(); bHasProjectScriptPlugin = Reader.ReadBool(); AdditionalArguments = Reader.ReadArray(() => Reader.ReadString()); PreBuildScripts = Reader.ReadArray(() => Reader.ReadFileReference()); Actions = Reader.ReadList(() => new Action(Reader)); EnvironmentVariables = Reader.ReadList(() => Tuple.Create(Reader.ReadString(), Reader.ReadString())); OutputItems = Reader.ReadList(() => Reader.ReadFileItem()); ModuleNameToOutputItems = Reader.ReadDictionary(() => Reader.ReadString(), () => Reader.ReadArray(() => Reader.ReadFileItem()), StringComparer.OrdinalIgnoreCase); HotReloadModuleNames = Reader.ReadHashSet(() => Reader.ReadString(), StringComparer.OrdinalIgnoreCase); DirectoryToSourceFiles = Reader.ReadDictionary(() => Reader.ReadDirectoryItem(), () => Reader.ReadArray(() => Reader.ReadFileItem())); WorkingSet = Reader.ReadHashSet(() => Reader.ReadFileItem()); CandidatesForWorkingSet = Reader.ReadHashSet(() => Reader.ReadFileItem()); UObjectModules = Reader.ReadList(() => new UHTModuleInfo(Reader)); UObjectModuleHeaders = Reader.ReadList(() => new UHTModuleHeaderInfo(Reader)); PluginFiles = Reader.ReadHashSet(() => Reader.ReadFileItem()); AdditionalDependencies = Reader.ReadHashSet(() => Reader.ReadFileItem()); }
/// <summary> /// Reads the content of this data from a stream archive. /// </summary> protected override bool Read(BinaryArchiveReader archive) { // Read the chuck version archive.Read3dmChunkVersion(out var major, out var minor); if (major == MAJOR_VERSION) { // Read 1.0 fields here if (minor >= MINOR_VERSION) { Notes = archive.ReadString(); } // Note, if you every roll the minor version number, // then read those fields here. } return(!archive.ReadErrorOccured); }
/// <summary> /// Reads data for this dependency cache from disk /// </summary> private void Read() { try { using (BinaryArchiveReader Reader = new BinaryArchiveReader(Location)) { int Version = Reader.ReadInt(); if (Version != CurrentVersion) { Log.TraceLog("Unable to read dependency cache from {0}; version {1} vs current {2}", Location, Version, CurrentVersion); return; } int FileToFirstIncludeCount = Reader.ReadInt(); for (int Idx = 0; Idx < FileToFirstIncludeCount; Idx++) { FileItem File = Reader.ReadCompactFileItem(); IncludeInfo IncludeInfo = new IncludeInfo(); IncludeInfo.LastWriteTimeUtc = Reader.ReadLong(); IncludeInfo.IncludeText = Reader.ReadString(); FileToIncludeInfo[File] = IncludeInfo; } int FileToMarkupFlagCount = Reader.ReadInt(); for (int Idx = 0; Idx < FileToMarkupFlagCount; Idx++) { FileItem File = Reader.ReadCompactFileItem(); ReflectionInfo ReflectionInfo = new ReflectionInfo(); ReflectionInfo.LastWriteTimeUtc = Reader.ReadLong(); ReflectionInfo.bContainsMarkup = Reader.ReadBool(); FileToReflectionInfo[File] = ReflectionInfo; } } } catch (Exception Ex) { Log.TraceWarning("Unable to read {0}. See log for additional information.", Location); Log.TraceLog("{0}", ExceptionUtils.FormatExceptionDetails(Ex)); } }
/// <summary> /// Construct an object from an archive on disk /// </summary> /// <param name="Reader">Archive to read from</param> public ConfigValueTracker(BinaryArchiveReader Reader) { Dependencies = Reader.ReadDictionary(() => new ConfigDependencyKey(Reader), () => (IReadOnlyList <string>)Reader.ReadList(() => Reader.ReadString())); }
protected override bool Read(BinaryArchiveReader archive) { my_object_name = archive.ReadString(); return(true); }