winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

PredefinedWriteableSourceFactory.h (1010B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #pragma once
      4 #include "ISource.h"
      5 #include "SourceFactory.h"
      6 
      7 #include <string_view>
      8 
      9 namespace AppInstaller::Repository::Microsoft
     10 {
     11     using namespace std::string_view_literals;
     12     
     13     // A source of installing packages on the local system.
     14     // Arg  ::  A value indicating the type of writeable source
     15     // Data ::  Not used.
     16     struct PredefinedWriteableSourceFactory
     17     {
     18         // Get the type string for this source.
     19         static constexpr std::string_view Type()
     20         {
     21             return "Microsoft.Predefined.Writeable"sv;
     22         }
     23 
     24         // The type for the source.
     25         enum class WriteableType
     26         {
     27             Installing
     28         };
     29 
     30         // Converts a type to its string.
     31         static std::string_view TypeToString(WriteableType type);
     32 
     33         // Creates a source factory for this type.
     34         static std::unique_ptr<ISourceFactory> Create();
     35     };
     36 }