ManifestYamlParser.h (1377B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #pragma once 4 #include <winget/ManifestValidation.h> 5 #include <winget/Manifest.h> 6 #include <winget/Yaml.h> 7 #include <AppInstallerSHA256.h> 8 #include <filesystem> 9 10 namespace AppInstaller::Manifest::YamlParser 11 { 12 struct YamlManifestInfo 13 { 14 // Root node of a yaml manifest file 15 YAML::Node Root; 16 17 // File name of the manifest file if applicable for error reporting 18 std::string FileName; 19 20 // Schema header string found in the manifest file 21 YAML::DocumentSchemaHeader DocumentSchemaHeader; 22 23 // The SHA256 hash of the stream 24 Utility::SHA256::HashBuffer StreamSha256; 25 26 ManifestTypeEnum ManifestType = ManifestTypeEnum::Preview; 27 }; 28 29 Manifest CreateFromPath( 30 const std::filesystem::path& inputPath, 31 ManifestValidateOption validateOption = {}, 32 const std::filesystem::path& mergedManifestPath = {}); 33 34 Manifest Create( 35 const std::string& input, 36 ManifestValidateOption validateOption = {}, 37 const std::filesystem::path& mergedManifestPath = {}); 38 39 Manifest ParseManifest( 40 std::vector<YamlManifestInfo>& input, 41 ManifestValidateOption validateOption = {}, 42 const std::filesystem::path& mergedManifestPath = {}); 43 }