/* This file is part of remwharead. * Copyright © 2019 tastytea * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "export/bookmarks.hpp" #include "sqlite.hpp" #include #include namespace remwharead { using std::chrono::system_clock; using std::chrono::duration_cast; using std::chrono::seconds; using std::string; void Export::Bookmarks::print() const { _out << "\n" "\n" "Bookmarks from remwharead\n" "

Bookmarks from remwharead

\n\n" "

\n" "

remwharead

\n" "

\n"; for (const Database::entry & entry : _entries) { string title = entry.title; if (title.empty()) { title = entry.uri; } system_clock::time_point tp = entry.datetime; system_clock::duration duration = tp.time_since_epoch(); string time_seconds = std::to_string(duration_cast(duration).count()); _out << "

" << title << "\n"; } _out << "

\n" << "

\n"; } } // namespace remwharead