24#include <miktex/Core/MD5>
25#include <miktex/Core/Session>
27#include "definitions.h"
28#include "RepositoryInfo.h"
30MIKTEX_PACKAGES_BEGIN_NAMESPACE;
36 std::size_t archiveFileSize = 0;
63 bool isObsolete =
false;
66 bool isRemovable =
false;
90 std::size_t sizeDocFiles = 0;
93 std::size_t sizeSourceFiles = 0;
96 std::size_t sizeRunFiles = 0;
125 return static_cast<unsigned long>(requiredBy.size());
132 return static_cast<unsigned long>(runFiles.size() + docFiles.size() + sourceFiles.size());
139 return sizeRunFiles + sizeDocFiles + sizeSourceFiles;
145 return IsValidTimeT(timeInstalledUser) ? timeInstalledUser : timeInstalledCommon;
151 return GetRefCount() > 0;
157 return !requiredPackages.empty();
184 return IsContainer() && GetNumFiles() <= 1;
193 timeInstalledUser = timeInstalled;
196 timeInstalledCommon = timeInstalled;
204inline bool operator==(
const PackageInfo& lhs,
const PackageInfo& rhs)
207 && lhs.copyrightOwner == rhs.copyrightOwner
208 && lhs.copyrightYear == rhs.copyrightYear
209 && lhs.creator == rhs.creator
210 && lhs.ctanPath == rhs.ctanPath
211 && lhs.description == rhs.description
212 && lhs.digest == rhs.digest
213 && lhs.displayName == rhs.displayName
215 && lhs.licenseType == rhs.licenseType
216 && lhs.requiredPackages == rhs.requiredPackages
217 && lhs.sizeDocFiles == rhs.sizeDocFiles
218 && lhs.sizeSourceFiles == rhs.sizeSourceFiles
219 && lhs.targetSystem == rhs.targetSystem
220 && lhs.timePackaged == rhs.timePackaged
221 && lhs.title == rhs.title
222 && lhs.version == rhs.version
223 && lhs.versionDate == rhs.versionDate
227 && lhs.sizeRunFiles == rhs.sizeRunFiles
232MIKTEX_PACKAGES_END_NAMESPACE;
Instances of this struct represent MD5 values.
Definition: MD5.h:46
ConfigurationScope
MiKTeX configuration scope.
Definition: Session.h:103
@ User
User configuration scope.
@ Common
Common (system-wide) configuration scope.
constexpr std::time_t InvalidTimeT
An invalid timestamp.
Definition: definitions.h:30
bool IsValidTimeT(std::time_t time)
Definition: definitions.h:35
RepositoryReleaseState
Repository release state.
Definition: RepositoryInfo.h:174
Package record.
Definition: PackageInfo.h:34
void SetTimeInstalled(std::time_t timeInstalled, MiKTeX::Core::ConfigurationScope scope)
Gets the time, the package was installed.
Definition: PackageInfo.h:188
std::string description
Multi-line package description.
Definition: PackageInfo.h:51
std::string copyrightOwner
The copyright owner of the package.
Definition: PackageInfo.h:39
std::string ctanPath
Relative path to the package directory on a CTAN mirror.
Definition: PackageInfo.h:48
std::string copyrightYear
Copyright year.
Definition: PackageInfo.h:42
bool IsInstalled() const
Checks to see whether the package is installed.
Definition: PackageInfo.h:161
bool IsPureContainer() const
Definition: PackageInfo.h:182
std::string displayName
Display name.
Definition: PackageInfo.h:57
std::vector< std::string > requiredBy
List of dependents.
Definition: PackageInfo.h:81
MiKTeX::Core::MD5 digest
MD5 of the package.
Definition: PackageInfo.h:54
std::string creator
Name of creator (packer).
Definition: PackageInfo.h:45
std::string versionDate
The version/date of the package.
Definition: PackageInfo.h:120
std::string minTargetSystemVersion
The minimum required target system version.
Definition: PackageInfo.h:75
std::size_t GetSize() const
Definition: PackageInfo.h:137
std::vector< std::string > sourceFiles
The source file list.
Definition: PackageInfo.h:99
std::vector< std::string > requiredPackages
List of required packages.
Definition: PackageInfo.h:84
std::time_t GetTimeInstalled() const
Gets the time, the package was installed.
Definition: PackageInfo.h:143
unsigned long GetNumFiles() const
Definition: PackageInfo.h:130
std::string id
Package ID.
Definition: PackageInfo.h:60
bool IsContained() const
Checks to see if this package has dependents.
Definition: PackageInfo.h:149
std::string version
Informal version information.
Definition: PackageInfo.h:117
std::vector< std::string > docFiles
The doc file list.
Definition: PackageInfo.h:69
std::string title
One-line package description.
Definition: PackageInfo.h:114
bool IsContainer() const
Tests for a container package.
Definition: PackageInfo.h:155
std::string targetSystem
Target system.
Definition: PackageInfo.h:102
bool IsInstalled(MiKTeX::Core::ConfigurationScope scope) const
Checks to see whether the package is installed in the specified scope.
Definition: PackageInfo.h:167
unsigned long GetRefCount() const
Gets the number of dependents.
Definition: PackageInfo.h:123
std::string licenseType
The license type of the package.
Definition: PackageInfo.h:72
std::vector< std::string > runFiles
The run file list.
Definition: PackageInfo.h:87