Skip to content

Class Ase::FileCrawler

ClassList > Ase > FileCrawler

Class implementing a file system crawler.

  • #include <crawler.hh>

Inherits the following classes: Ase::ObjectImpl, Ase::ResourceCrawler

Public Types inherited from Ase::ResourceCrawler

See Ase::ResourceCrawler

Type Name
typedef std::pair< String, String > String2

Public Attributes inherited from Ase::ResourceCrawler

See Ase::ResourceCrawler

Type Name
Member<&ResourceCrawler::entries_ > entries
The entries in the current folder, UTF-8 encoded.
Member<&ResourceCrawler::folder_ > folder
The folder currently being browsed, UTF-8 encoded.

Public Functions

Type Name
ASE_DEFINE_MAKE_SHARED (FileCrawler)
virtual String2 assign (const String & utf8path, bool existingfile) override
virtual 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.
virtual Resource current_folder () override
Return the current folder.
String expand_fsdir (const String & fsdir)
Expand directory name (file system encoding) to absolute folder path.
virtual ResourceS list_entries () override
List all entries in the current folder.

Public Functions inherited from Ase::EmittableImpl

See Ase::EmittableImpl

Type Name
virtual void emit_event (const String & type, const String & detail, const ValueR fields={}) override
virtual void emit_notify (const String & detail) override
Emit notify:detail , multiple notifications maybe coalesced if a CoalesceNotifies instance exists.
virtual ASE_USE_RESULT Connection on_event (const String & eventselector, const EventHandler & eventhandler) override

Public Functions inherited from Ase::Emittable

See Ase::Emittable

Type Name
virtual void emit_event (const String & type, const String & detail, const ValueR fields={}) = 0
virtual void emit_notify (const String & detail) = 0
void js_trigger (const String & eventselector, JsTrigger callback)
virtual ASE_USE_RESULT Connection on_event (const String & eventselector, const EventHandler & eventhandler) = 0

Public Functions inherited from Ase::Emittable

See Ase::Emittable

Type Name
virtual void emit_event (const String & type, const String & detail, const ValueR fields={}) = 0
virtual void emit_notify (const String & detail) = 0
void js_trigger (const String & eventselector, JsTrigger callback)
virtual ASE_USE_RESULT Connection on_event (const String & eventselector, const EventHandler & eventhandler) = 0

Public Functions inherited from Ase::ResourceCrawler

See Ase::ResourceCrawler

Type Name
virtual String2 assign (const String & utf8path, bool existingfile=false) = 0
virtual Resource canonify (const String & utf8cwd, const String & utf8fragment, bool constraindir, bool constrainfile) = 0
Return absolute path, slash-terminated if directory, constrain to existing paths.
virtual Resource current_folder () = 0
Describe current folder.
virtual ResourceS list_entries () = 0
List entries of a folder.

Public Functions inherited from Ase::Emittable

See Ase::Emittable

Type Name
virtual void emit_event (const String & type, const String & detail, const ValueR fields={}) = 0
virtual void emit_notify (const String & detail) = 0
void js_trigger (const String & eventselector, JsTrigger callback)
virtual ASE_USE_RESULT Connection on_event (const String & eventselector, const EventHandler & eventhandler) = 0

Protected Functions

Type Name
String2 assign_ (const String & utf8path, bool existingfile, bool notify=true)
Open a new folder and make it the current folder.
virtual bool entries_ (const ResourceS * n, ResourceS * q) override
virtual bool folder_ (const Resource * n, Resource * q) override

Protected Functions inherited from Ase::ObjectImpl

See Ase::ObjectImpl

Type Name
virtual ~ObjectImpl () = 0

Protected Functions inherited from Ase::EmittableImpl

See Ase::EmittableImpl

Type Name
virtual ~EmittableImpl ()

Protected Functions inherited from Ase::VirtualBase

See Ase::VirtualBase

Type Name
virtual ~VirtualBase () noexcept = 0

Protected Functions inherited from Ase::Object

See Ase::Object

Type Name
virtual ~Object () = 0

Protected Functions inherited from Ase::VirtualBase

See Ase::VirtualBase

Type Name
virtual ~VirtualBase () noexcept = 0

Protected Functions inherited from Ase::ResourceCrawler

See Ase::ResourceCrawler

Type Name
ResourceCrawler ()
virtual bool entries_ (const ResourceS * n, ResourceS * q) = 0
virtual bool folder_ (const Resource * n, Resource * q) = 0

Protected Functions inherited from Ase::Object

See Ase::Object

Type Name
virtual ~Object () = 0

Protected Functions inherited from Ase::VirtualBase

See Ase::VirtualBase

Type Name
virtual ~VirtualBase () noexcept = 0

Public Functions Documentation

function ASE_DEFINE_MAKE_SHARED

Ase::FileCrawler::ASE_DEFINE_MAKE_SHARED (
    FileCrawler
) 

function assign

inline virtual String2 Ase::FileCrawler::assign (
    const String & utf8path,
    bool existingfile
) override

Move to a different path.

Implements Ase::ResourceCrawler::assign


function canonify

virtual Resource Ase::FileCrawler::canonify (
    const String & utf8cwd,
    const String & utf8fragment,
    bool constraindir,
    bool constrainfile
) override

Implements Ase::ResourceCrawler::canonify


function canonify_fspath

String Ase::FileCrawler::canonify_fspath (
    const String & fspath,
    const String & fsfragment,
    bool constraindir,
    bool constrainfile
) 

function current_folder

virtual Resource Ase::FileCrawler::current_folder () override

Implements Ase::ResourceCrawler::current_folder


function expand_fsdir

String Ase::FileCrawler::expand_fsdir (
    const String & fsdir
) 

function list_entries

virtual ResourceS Ase::FileCrawler::list_entries () override

Implements Ase::ResourceCrawler::list_entries


Protected Functions Documentation

function assign_

String2 Ase::FileCrawler::assign_ (
    const String & utf8path,
    bool existingfile,
    bool notify=true
) 

function entries_

virtual bool Ase::FileCrawler::entries_ (
    const ResourceS * n,
    ResourceS * q
) override

Implements Ase::ResourceCrawler::entries_


function folder_

virtual bool Ase::FileCrawler::folder_ (
    const Resource * n,
    Resource * q
) override

Implements Ase::ResourceCrawler::folder_



The documentation for this class was generated from the following file /__w/anklang/anklang/ase/crawler.hh