winget-cli

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

SourceUpdateChecks.h (1056B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #pragma once
      4 #include "Public/winget/RepositorySource.h"
      5 #include <chrono>
      6 
      7 namespace AppInstaller::Repository
      8 {
      9     // Determines if the given source should update before opening.
     10     bool ShouldUpdateBeforeOpen(ISourceReference* sourceReference, const std::optional<TimeSpan>& requestedUpdateInterval);
     11 
     12     // Determines if the current time is before a previously stored "do note update before" time.
     13     bool IsBeforeDoNotUpdateBeforeTime(const SourceDetails& details);
     14 
     15     // Determines if the given details and desired update interval indicate an update check should occur.
     16     bool IsAfterUpdateCheckTime(const SourceDetails& details, std::optional<TimeSpan> requestedUpdateInterval);
     17 
     18     // Determines if the given details and desired update interval indicate an update check should occur.
     19     bool IsAfterUpdateCheckTime(std::string_view name, std::chrono::system_clock::time_point lastUpdateTime, std::optional<TimeSpan> requestedUpdateInterval);
     20 }