Anklang-0.3.0.dev956+gd75ac925 anklang-0.3.0.dev956+gd75ac925
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
crawler.hh
Go to the documentation of this file.
1 // This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
2#pragma once
3
4#include <ase/gadget.hh>
5
6namespace Ase {
7
9class FileCrawler final : public ObjectImpl, public virtual ResourceCrawler {
10 String cwd_;
11 const uint constraindir_ : 1;
12 [[maybe_unused]]
13 const uint constrainfile_ : 1;
14 FileCrawler (const String &cwd, bool constraindir = false, bool constrainfile = false);
15protected:
16 String2 assign_ (const String &utf8path, bool existingfile, bool notify = true);
17 Resource folder () const override;
18 void folder (const Resource &newfolder) override;
19 ResourceS entries () const override;
20 void entries (const ResourceS &newentries) override;
21public:
23 ResourceS list_entries ();
25 String2 assign (const String &utf8path,
26 bool existingfile) override { return assign_ (utf8path, existingfile, true); }
27 Resource canonify (const String &utf8cwd, const String &utf8fragment, bool constraindir, bool constrainfile) override;
28 String canonify_fspath (const String &fspath, const String &fsfragment, bool constraindir, bool constrainfile);
29 String expand_fsdir (const String &fsdir);
30};
31
32} // Ase
33
Class implementing a file system crawler.
Definition crawler.hh:9
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.
Definition crawler.cc:189
ResourceS list_entries()
List all entries in the current folder.
Definition crawler.cc:35
String2 assign(const String &utf8path, bool existingfile) override
Move to a different path.
Definition crawler.hh:25
String expand_fsdir(const String &fsdir)
Expand directory name (file system encoding) to absolute folder path.
Definition crawler.cc:75
Resource current_folder()
Return the current folder.
Definition crawler.cc:89
String2 assign_(const String &utf8path, bool existingfile, bool notify=true)
Open a new folder and make it the current folder.
Definition crawler.cc:131
ResourceS entries() const override
List entries of a folder.
Definition crawler.cc:118
Resource folder() const override
Describe current folder.
Definition crawler.cc:106
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.
Definition crawler.cc:225
Implementation type for classes with Property interfaces.
Definition object.hh:40
Helper to crawl hierarchical resources.
Definition api.hh:358
#define ASE_DEFINE_MAKE_SHARED(CLASS)
Define a member function static shared_ptr<CLASS> make_shared(ctorargs...);.
Definition cxxaux.hh:274
The Anklang C++ API namespace.
Definition api.hh:8
uint32_t uint
Provide 'uint' as convenience type.
Definition cxxaux.hh:17
Description of a resource, possibly nested.
Definition api.hh:349