ohmy god
This commit is contained in:
parent
8bd18187fc
commit
f476aa6a94
1 changed files with 5 additions and 2 deletions
|
@ -3,20 +3,23 @@
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#include "src/core/package.hpp"
|
#include "src/core/package.hpp"
|
||||||
|
|
||||||
|
#include <fstream>
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
#include "src/util/defs.hpp"
|
#include "src/util/defs.hpp"
|
||||||
#include "src/util/error.hpp"
|
#include "src/util/error.hpp"
|
||||||
#include "src/util/types.hpp"
|
#include "src/util/types.hpp"
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
using util::error::DracError, util::error::DracErrorCode;
|
using util::error::DracError, util::error::DracErrorCode;
|
||||||
using util::types::u64, util::types::String, util::types::Result;
|
using util::types::u64, util::types::String, util::types::Result, util::types::Err;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
fn CountUniquePackages(const String& dbPath) -> Result<u64, DracError> {
|
fn CountUniquePackages(const String& dbPath) -> Result<u64, DracError> {
|
||||||
std::ifstream dbFile(dbPath);
|
std::ifstream dbFile(dbPath);
|
||||||
|
|
||||||
if (!dbFile.is_open())
|
if (!dbFile.is_open())
|
||||||
return Err(DracError(DracErrorCode::NotFound, std::format("Failed to open file: {}", dbPath.string())));
|
return Err(DracError(DracErrorCode::NotFound, std::format("Failed to open file: {}", dbPath)));
|
||||||
|
|
||||||
std::unordered_set<String> uniquePackages;
|
std::unordered_set<String> uniquePackages;
|
||||||
String line;
|
String line;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue