LCOV - code coverage report
Current view: top level - source/common/filesystem - directory.h (source / functions) Hit Total Coverage
Test: coverage.dat Lines: 3 3 100.0 %
Date: 2024-01-05 06:35:25 Functions: 3 3 100.0 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include <string>
       4             : 
       5             : #include "envoy/filesystem/filesystem.h"
       6             : 
       7             : #include "source/common/filesystem/directory_iterator_impl.h"
       8             : 
       9             : namespace Envoy {
      10             : namespace Filesystem {
      11             : 
      12             : // This class does not do any validation of input data. Do not use with untrusted inputs.
      13             : //
      14             : // DirectoryIteratorImpl will fail silently and act like an empty iterator in case of
      15             : // error opening the directory, and will silently skip files that can't be stat'ed. Check
      16             : // DirectoryIteratorImpl::status() after initialization and after each increment if
      17             : // silent failure is not the desired behavior.
      18             : class Directory {
      19             : public:
      20          37 :   Directory(const std::string& directory_path) : directory_path_(directory_path) {}
      21             : 
      22          37 :   DirectoryIteratorImpl begin() { return {directory_path_}; }
      23             : 
      24          37 :   DirectoryIteratorImpl end() { return {}; }
      25             : 
      26             : private:
      27             :   const std::string directory_path_;
      28             : };
      29             : 
      30             : } // namespace Filesystem
      31             : } // namespace Envoy

Generated by: LCOV version 1.15