.. _program_listing_file_include_zim_entry.h: Program Listing for File entry.h ================================ |exhale_lsh| :ref:`Return to documentation for file ` (``include/zim/entry.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Copyright (C) 2020 Matthieu Gautier * * 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; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * is provided AS IS, WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, and * NON-INFRINGEMENT. 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, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef ZIM_ENTRY_H #define ZIM_ENTRY_H #include "zim.h" #include #include namespace zim { class Item; class Dirent; class FileImpl; class LIBZIM_API Entry { public: explicit Entry(std::shared_ptr file_, entry_index_type idx_); bool isRedirect() const; std::string getTitle() const; std::string getPath() const; Item getItem(bool follow=false) const; Item getRedirect() const; Entry getRedirectEntry() const; entry_index_type getRedirectEntryIndex() const; entry_index_type getIndex() const { return m_idx; } protected: // so that Item can be implemented as a wrapper over Entry std::shared_ptr m_file; entry_index_type m_idx; std::shared_ptr m_dirent; }; } #endif // ZIM_ENTRY_H