Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)
« « « Anklang Documentation |
Class implementing a file system crawler. More...
#include "crawler.hh"
Public Member Functions | |
ASE_DEFINE_MAKE_SHARED (FileCrawler) | |
ResourceS | list_entries () |
List all entries in the current folder. | |
Resource | current_folder () |
Return the current folder. | |
String2 | assign (const String &utf8path, bool existingfile) override |
Resource | canonify (const String &utf8cwd, const String &utf8fragment, bool constraindir, bool constrainfile) override |
Canonify a UTF-8 path name, optionally constraining it to a folder or file. | |
String | canonify_fspath (const String &fspath, const String &fsfragment, bool constraindir, bool constrainfile) |
Canonify a path (file system encoding), optionally constraining it to a directory or file. | |
String | expand_fsdir (const String &fsdir) |
Expand directory name (file system encoding) to absolute folder path. | |
![]() | |
ASE_USE_RESULT Connection | on_event (const String &eventselector, const EventHandler &eventhandler) override |
void | emit_event (const String &type, const String &detail, const ValueR fields={}) override |
void | emit_notify (const String &detail) override |
Emit notify:detail , multiple notifications maybe coalesced if a CoalesceNotifies instance exists. | |
![]() | |
void | js_trigger (const String &eventselector, JsTrigger callback) |
![]() | |
T | enable_shared_from_this (T... args) |
T | operator= (T... args) |
T | shared_from_this (T... args) |
T | weak_from_this (T... args) |
T | ~enable_shared_from_this (T... args) |
Protected Member Functions | |
String2 | assign_ (const String &utf8path, bool existingfile, bool notify=true) |
Open a new folder and make it the current folder. | |
Resource | get_folder () const override |
Describe current folder. | |
void | set_folder (const Resource &newfolder) override |
ResourceS | get_entries () const override |
List entries of a folder. | |
void | set_entries (const ResourceS &newentries) override |
Additional Inherited Members | |
![]() | |
using | String2 = std::pair< String, String > |
![]() | |
const EventHandler & | eventhandler |
![]() | |
Member<&ResourceCrawler::get_folder,&ResourceCrawler::set_folder > | folder |
The folder currently being browsed, UTF-8 encoded. | |
Member<&ResourceCrawler::get_entries,&ResourceCrawler::set_entries > | entries |
The entries in the current folder, UTF-8 encoded. | |
Class implementing a file system crawler.
Definition at line 10 of file crawler.hh.
Move to a different path.
Implements Ase::ResourceCrawler.
Definition at line 26 of file crawler.hh.
References assign_().
|
protected |
Open a new folder and make it the current folder.
Definition at line 133 of file crawler.cc.
References Ase::anklang_runpath(), Ase::decodefs(), std::string::empty(), std::filesystem::path::filename(), std::string::find(), std::filesystem::path::is_absolute(), std::filesystem::path::lexically_normal(), std::filesystem::path::parent_path(), std::filesystem::path::string(), and Ase::string_isupper().
Referenced by assign().
|
overridevirtual |
Canonify a UTF-8 path name, optionally constraining it to a folder or file.
Implements Ase::ResourceCrawler.
Definition at line 227 of file crawler.cc.
References Ase::decodefs(), Ase::displayfs(), Ase::encodefs(), Ase::string_endswith(), and Ase::Resource::type.
String Ase::FileCrawler::canonify_fspath | ( | const String & | fspath, |
const String & | fsfragment, | ||
bool | constraindir, | ||
bool | constrainfile | ||
) |
Canonify a path (file system encoding), optionally constraining it to a directory or file.
Definition at line 191 of file crawler.cc.
References std::filesystem::path::filename(), std::filesystem::path::is_absolute(), std::filesystem::path::lexically_normal(), std::filesystem::path::parent_path(), and std::filesystem::path::relative_path().
Resource Ase::FileCrawler::current_folder | ( | ) |
Return the current folder.
Definition at line 91 of file crawler.cc.
References Ase::displayfs(), Ase::encodefs(), lstat(), stat(), and Ase::Resource::type.
Referenced by get_folder().
Expand directory name (file system encoding) to absolute folder path.
Definition at line 77 of file crawler.cc.
References Ase::anklang_runpath(), std::string::empty(), and Ase::string_toupper().
|
overrideprotectedvirtual |
List entries of a folder.
Implements Ase::ResourceCrawler.
Definition at line 120 of file crawler.cc.
References list_entries().
|
overrideprotectedvirtual |
Describe current folder.
Implements Ase::ResourceCrawler.
Definition at line 108 of file crawler.cc.
References current_folder().
ResourceS Ase::FileCrawler::list_entries | ( | ) |
List all entries in the current folder.
Definition at line 37 of file crawler.cc.
References closedir(), dirfd(), Ase::displayfs(), Ase::encodefs(), errno(), fstatat(), opendir(), readdir(), return_unless, std::string::size(), ssize_t, stat(), strerror(), and Ase::Resource::type.
Referenced by get_entries().
|
overrideprotectedvirtual |
Implements Ase::ResourceCrawler.
Definition at line 126 of file crawler.cc.
|
overrideprotectedvirtual |
Implements Ase::ResourceCrawler.
Definition at line 114 of file crawler.cc.