#pragma once #include #include struct PasswordEntry { std::string url; std::string username; std::string password; std::string http_realm; std::string form_action_origin; std::string guid; std::string time_created; std::string time_last_used; std::string time_password_changed; }; // Host part of a URL, lowercased, without scheme, port, path and credentials. std::string UrlHost(const std::string &url); class PasswordManager { public: PasswordManager(); void load(); void save(); // Import a Firefox password export (CSV format). Entries already present // (same url + username) are kept as they are. Returns the number of // entries added. int importFirefoxCsv(const std::string &csv_path); const std::vector &getEntries() const { return entries_; } void removeEntry(size_t index); private: std::vector entries_; std::string getPasswordsFilePath() const; };