LCOV - code coverage report
Current view: top level - include/client - open_dir.hpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 2 2 100.0 %
Date: 2024-04-30 13:21:35 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   Copyright 2018-2024, Barcelona Supercomputing Center (BSC), Spain
       3             :   Copyright 2015-2024, Johannes Gutenberg Universitaet Mainz, Germany
       4             : 
       5             :   This software was partially supported by the
       6             :   EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).
       7             : 
       8             :   This software was partially supported by the
       9             :   ADA-FS project under the SPPEXA project funded by the DFG.
      10             : 
      11             :   This file is part of GekkoFS' POSIX interface.
      12             : 
      13             :   GekkoFS' POSIX interface is free software: you can redistribute it and/or
      14             :   modify it under the terms of the GNU Lesser General Public License as
      15             :   published by the Free Software Foundation, either version 3 of the License,
      16             :   or (at your option) any later version.
      17             : 
      18             :   GekkoFS' POSIX interface is distributed in the hope that it will be useful,
      19             :   but WITHOUT ANY WARRANTY; without even the implied warranty of
      20             :   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      21             :   GNU Lesser General Public License for more details.
      22             : 
      23             :   You should have received a copy of the GNU Lesser General Public License
      24             :   along with GekkoFS' POSIX interface.  If not, see
      25             :   <https://www.gnu.org/licenses/>.
      26             : 
      27             :   SPDX-License-Identifier: LGPL-3.0-or-later
      28             : */
      29             : 
      30             : #ifndef GEKKOFS_OPEN_DIR_HPP
      31             : #define GEKKOFS_OPEN_DIR_HPP
      32             : 
      33             : #include <string>
      34             : #include <vector>
      35             : 
      36             : #include <client/open_file_map.hpp>
      37             : 
      38             : namespace gkfs::filemap {
      39             : 
      40        8244 : class DirEntry {
      41             : private:
      42             :     std::string name_;
      43             :     FileType type_;
      44             : 
      45             : public:
      46             :     DirEntry(const std::string& name, FileType type);
      47             : 
      48             :     const std::string&
      49             :     name();
      50             : 
      51             :     FileType
      52             :     type();
      53             : };
      54             : 
      55          25 : class OpenDir : public OpenFile {
      56             : private:
      57             :     std::vector<DirEntry> entries;
      58             : 
      59             : 
      60             : public:
      61             :     explicit OpenDir(const std::string& path);
      62             : 
      63             :     void
      64             :     add(const std::string& name, const FileType& type);
      65             : 
      66             :     const DirEntry&
      67             :     getdent(unsigned int pos);
      68             : 
      69             :     size_t
      70             :     size();
      71             : };
      72             : 
      73             : } // namespace gkfs::filemap
      74             : 
      75             : #endif // GEKKOFS_OPEN_DIR_HPP

Generated by: LCOV version 1.16