Ejemplo n.º 1
0
 public void Export(IExportContainer container, Object asset, string path)
 {
     using (FileStream fileStream = File.Open(path, FileMode.Create, FileAccess.Write))
     {
         using (StreamWriter streamWriter = new StreamWriter(fileStream))
         {
             YAMLWriter   writer = new YAMLWriter();
             YAMLDocument doc    = asset.ExportYAMLDocument(container);
             writer.AddDocument(doc);
             writer.Write(streamWriter);
         }
     }
 }
Ejemplo n.º 2
0
 public void Export(IExportContainer container, Object asset, string path, Action <IExportContainer, Object, string> callback)
 {
     using (FileStream fileStream = FileUtils.Open(path, FileMode.Create, FileAccess.Write))
     {
         using (StreamWriter streamWriter = new InvariantStreamWriter(fileStream, Encoding.UTF8))
         {
             YAMLWriter   writer = new YAMLWriter();
             YAMLDocument doc    = asset.ExportYAMLDocument(container);
             writer.AddDocument(doc);
             writer.Write(streamWriter);
         }
     }
     callback?.Invoke(container, asset, path);
 }
Ejemplo n.º 3
0
 public bool Export(IExportContainer container, Object asset, string path)
 {
     using (Stream fileStream = FileUtils.CreateVirtualFile(path))
     {
         using (StreamWriter streamWriter = new InvariantStreamWriter(fileStream, new UTF8Encoding(false)))
         {
             YAMLWriter   writer = new YAMLWriter();
             YAMLDocument doc    = asset.ExportYAMLDocument(container);
             writer.AddDocument(doc);
             writer.Write(streamWriter);
         }
     }
     return(true);
 }
Ejemplo n.º 4
0
 public void Export(IExportContainer container, Object asset, string path, Action <IExportContainer, Object, string> callback)
 {
     using (Stream fileStream = FileUtils.CreateVirtualFile(path))
     {
         using (StreamWriter streamWriter = new InvariantStreamWriter(fileStream, new UTF8Encoding(false)))
         {
             YAMLWriter   writer = new YAMLWriter();
             YAMLDocument doc    = asset.ExportYAMLDocument(container);
             writer.AddDocument(doc);
             writer.Write(streamWriter);
         }
     }
     callback?.Invoke(container, asset, path);
 }
 private void ExportYAML(IAssetsExporter exporter, UtinyRipper.Classes.Object asset, string path)
 {
     using (FileStream fileStream = File.Open(path, FileMode.Create, FileAccess.Write))
     {
         using (StreamWriter streamWriter = new StreamWriter(fileStream))
         {
             YAMLWriter writer = new YAMLWriter();
             exporter.File = asset.File;
             YAMLDocument doc = asset.ExportYAMLDocument(exporter);
             writer.AddDocument(doc);
             writer.Write(streamWriter);
         }
     }
 }
Ejemplo n.º 6
0
        protected void ExportMeta(ProjectAssetContainer container, Meta meta, string filePath)
        {
            string metaPath = $"{filePath}.meta";

            using (FileStream fileStream = System.IO.File.Open(metaPath, FileMode.Create, FileAccess.Write))
            {
                using (StreamWriter streamWriter = new StreamWriter(fileStream))
                {
                    YAMLWriter   writer = new YAMLWriter();
                    YAMLDocument doc    = meta.ExportYAMLDocument(container);
                    writer.IsWriteDefaultTag = false;
                    writer.IsWriteVersion    = false;
                    writer.AddDocument(doc);
                    writer.Write(streamWriter);
                }
            }
        }
Ejemplo n.º 7
0
        protected void ExportMeta(IExportContainer container, Meta meta, string filePath)
        {
            string metaPath = $"{filePath}.meta";

            using (Stream fileStream = FileUtils.CreateVirtualFile(metaPath))
            {
                using (StreamWriter streamWriter = new InvariantStreamWriter(fileStream, new UTF8Encoding(false)))
                {
                    YAMLWriter   writer = new YAMLWriter();
                    YAMLDocument doc    = meta.ExportYAMLDocument(container);
                    writer.IsWriteDefaultTag = false;
                    writer.IsWriteVersion    = false;
                    writer.AddDocument(doc);
                    writer.Write(streamWriter);
                }
            }
        }
 private void ExportYAML(IAssetsExporter exporter, IEnumerable <UtinyRipper.Classes.Object> objects, string path)
 {
     using (FileStream fileStream = File.Open(path, FileMode.Create, FileAccess.Write))
     {
         using (StreamWriter streamWriter = new StreamWriter(fileStream))
         {
             YAMLWriter writer = new YAMLWriter();
             foreach (Object @object in objects)
             {
                 exporter.File = @object.File;
                 YAMLDocument doc = @object.ExportYAMLDocument(exporter);
                 writer.AddDocument(doc);
             }
             writer.Write(streamWriter);
         }
     }
 }
Ejemplo n.º 9
0
        protected static void ExportMeta(IExportContainer container, Meta meta, string filePath)
        {
            string metaPath = $"{filePath}{MetaExtension}";

            using (var fileStream = FileUtils.CreateVirtualFile(metaPath))
                using (var stream = new BufferedStream(fileStream))
                    using (var streamWriter = new InvariantStreamWriter(stream, new UTF8Encoding(false)))
                    {
                        YAMLWriter writer = new YAMLWriter();
                        writer.IsWriteDefaultTag = false;
                        writer.IsWriteVersion    = false;
                        writer.IsFormatKeys      = true;
                        YAMLDocument doc = meta.ExportYAMLDocument(container);
                        writer.AddDocument(doc);
                        writer.Write(streamWriter);
                    }
        }
Ejemplo n.º 10
0
 public void Export(ProjectAssetContainer container, IEnumerable <Object> assets, string path)
 {
     using (FileStream fileStream = File.Open(path, FileMode.Create, FileAccess.Write))
     {
         using (StreamWriter streamWriter = new StreamWriter(fileStream))
         {
             YAMLWriter writer = new YAMLWriter();
             foreach (Object asset in assets)
             {
                 container.File = asset.File;
                 YAMLDocument doc = asset.ExportYAMLDocument(container);
                 writer.AddDocument(doc);
             }
             writer.Write(streamWriter);
         }
     }
 }
Ejemplo n.º 11
0
        protected void ExportMeta(IAssetsExporter exporter, IExportCollection collection, string filePath)
        {
            Meta   meta     = new Meta(collection);
            string metaPath = $"{filePath}.meta";

            using (FileStream fileStream = File.Open(metaPath, FileMode.Create, FileAccess.Write))
            {
                using (StreamWriter streamWriter = new StreamWriter(fileStream))
                {
                    YAMLWriter   writer = new YAMLWriter();
                    YAMLDocument doc    = meta.ExportYAMLDocument(exporter);
                    writer.IsWriteDefaultTag = false;
                    writer.IsWriteVersion    = false;
                    writer.AddDocument(doc);
                    writer.Write(streamWriter);
                }
            }
        }