kodi
NFSDirectory.h
1 /*
2  * Copyright (C) 2011-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "IDirectory.h"
12 #include "NFSFile.h"
13 
14 struct nfsdirent;
15 
16 namespace XFILE
17 {
18  class CNFSDirectory : public IDirectory
19  {
20  public:
21  CNFSDirectory(void);
22  ~CNFSDirectory(void) override;
23  bool GetDirectory(const CURL& url, CFileItemList &items) override;
24  DIR_CACHE_TYPE GetCacheType(const CURL& url) const override { return DIR_CACHE_ONCE; }
25  bool Create(const CURL& url) override;
26  bool Exists(const CURL& url) override;
27  bool Remove(const CURL& url) override;
28  private:
29  bool GetServerList(CFileItemList &items);
30  bool GetDirectoryFromExportList(const std::string& strPath, CFileItemList &items);
31  bool ResolveSymlink( const std::string &dirName, struct nfsdirent *dirent, CURL &resolvedUrl);
32  };
33 }
34 
bool Exists(const CURL &url) override
Check for directory existence.
Definition: NFSDirectory.cpp:361
Interface to the directory on a file system.
Definition: IDirectory.h:51
Definition: Scraper.h:41
Represents a list of files.
Definition: FileItem.h:702
Definition: URL.h:21
Definition: dirent.h:39
DIR_CACHE_TYPE GetCacheType(const CURL &url) const override
How this directory should be cached.
Definition: NFSDirectory.h:24
bool Remove(const CURL &url) override
Removes the directory.
Definition: NFSDirectory.cpp:337
Definition: NFSDirectory.h:18
bool Create(const CURL &url) override
Create the directory.
Definition: NFSDirectory.cpp:314
bool GetDirectory(const CURL &url, CFileItemList &items) override
Get the items of the directory strPath.
Definition: NFSDirectory.cpp:201