namespace WrtDeviceApis {
namespace Filesystem {
-
class Manager : public Api::IManager
{
public:
* only by virtual roots.
*/
bool access(const Api::IPathPtr& path,
- int accessType) const;
+ int accessType) const;
void addOpenedNode(const Api::INodePtr& node);
void removeOpenedNode(const Api::INodePtr& node);
protected:
bool matchFilters(const std::string& name,
- const struct stat& info,
- const Api::FiltersMap& filter);
+ const struct stat& info,
+ const Api::FiltersMap& filter);
void OnRequestReceived(const Api::EventResolvePtr& event);
void OnRequestReceived(const Api::EventCopyPtr& event);
static void setupLocation(Api::LocationType location,
const char* path);
+ void copyElement(const std::string &src,
+ const std::string &dest,
+ bool recursive = true) const;
+
+ /**
+ * Check two paths to copy/move. Checks if they are not the same and
+ * required permissions.
+ * @param src
+ * @param dest
+ */
+ void checkPaths(Api::IPathPtr &src, Api::IPathPtr &dest);
+ bool pathExists(const std::string &path);
+
private:
static Locations m_locations; ///< Paths to default locations.
static const std::size_t m_maxPathLength; ///< Maximum path length.
- static Api::NodeList m_openedNodes; ///< List of nodes that has opened streams.
+ static Api::NodeList m_openedNodes; ///< List of nodes that has opened
+ // streams.
};
-
} // Filesystem
} // WrtDeviceApis