winget-cli

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

ArgumentValidation.h (1567B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #pragma once
      4 #include <winrt/Windows.Foundation.h>
      5 
      6 namespace winrt::Microsoft::Management::Configuration::implementation
      7 {
      8     // Ensures that the given type is supported.
      9     void EnsureSupportedType(Windows::Foundation::PropertyType type);
     10 
     11     // Ensures that the value object matches the expected property type.
     12     bool IsValidObjectType(Windows::Foundation::IInspectable const& value, Windows::Foundation::PropertyType type);
     13 
     14     // Ensures that the value object matches the expected property type.
     15     void EnsureObjectType(Windows::Foundation::IInspectable const& value, Windows::Foundation::PropertyType type);
     16 
     17     // Determines if the given type supports comparison.
     18     bool IsComparableType(Windows::Foundation::PropertyType type);
     19 
     20     // Ensures that the given type supports comparison.
     21     void EnsureComparableType(Windows::Foundation::PropertyType type);
     22 
     23     // Determines if the given type supports length restrictions.
     24     bool IsLengthType(Windows::Foundation::PropertyType type);
     25 
     26     // Ensures that the given type supports length restrictions.
     27     void EnsureLengthType(Windows::Foundation::PropertyType type);
     28 
     29     // Determines if the given type is a scalar that can be converted to a reasonable string representation.
     30     bool IsStringableType(Windows::Foundation::PropertyType type);
     31 
     32     // Gets the string version of the given property, if it is stringable.
     33     hstring ToString(Windows::Foundation::IPropertyValue value);
     34 }