+ for (auto const & package : packages_) {
+ if (package.first == n)
+ return true;
+ }
+ return false;
+}
+
+
+bool LaTeXPackages::isAvailableAtLeastFrom(string const & name,
+ int const y, int const m, int const d)
+{
+ if (packages_.empty())
+ getAvailable();
+
+ // required date as int (yyyymmdd)
+ int const req_date = (y * 10000) + (m * 100) + d;
+ for (auto const & package : packages_) {
+ if (package.first == name && !package.second.empty()) {
+ if (!isStrInt(package.second)) {
+ LYXERR0("Warning: Invalid date of package "
+ << package.first << " (" << package.second << ")");
+ continue;
+ }
+ // required date not newer than available date
+ return req_date <= convert<int>(package.second);
+ }
+ }
+ return false;