<commit_before>#ifndef PICOLIB_IO_H_
#define PICOLIB_IO_H_

namespace Pico {

    namespace Filesystem {

        class File : public BasicStream
        {
            public:
                constexpr static int READ       = (1 << 0);
                constexpr static int WRITE      = (1 << 1);
                constexpr static int APPEND     = (1 << 2);
                constexpr static int TRUNCATE   = (1 << 3);

                FUNCTION File   open(const char *path, int flags);
                FUNCTION File   create(const char *path, int flags, mode_t mode);
                FUNCTION int    remove(const char *path);

                CONSTRUCTOR     File(const char *path, int flags = READ|WRITE, bool create = false, mode_t mode = 0700);
        };

        class Directory : public SingleIO
        {
            public:
                FUNCTION        Directory open(const char *path);
                FUNCTION int    create(const char *path, mode_t mode);
                FUNCTION int    remove(const char *path);

                template <typename Func>
                FUNCTION int    each(const char *path, Func);
                FUNCTION int    set_current(const char *path);
                FUNCTION int    get_current(char *path, size_t size);
                FUNCTION int    change_root(const char *path);

                CONSTRUCTOR Directory(const char *path);

                template <typename Func>
                METHOD int      list(Func);<commit_msg>pico/fs: import SingleIO constructor in Directory<commit_after>#ifndef PICOLIB_IO_H_
#define PICOLIB_IO_H_

namespace Pico {

    namespace Filesystem {

        class File : public BasicStream
        {
            public:
                constexpr static int READ       = (1 << 0);
                constexpr static int WRITE      = (1 << 1);
                constexpr static int APPEND     = (1 << 2);
                constexpr static int TRUNCATE   = (1 << 3);

                FUNCTION File   open(const char *path, int flags);
                FUNCTION File   create(const char *path, int flags, mode_t mode);
                FUNCTION int    remove(const char *path);

                CONSTRUCTOR     File(const char *path, int flags = READ|WRITE, bool create = false, mode_t mode = 0700);
        };

        class Directory : public SingleIO
        {
            public:
                using SingleIO::SingleIO;

                FUNCTION        Directory open(const char *path);
                FUNCTION int    create(const char *path, mode_t mode);
                FUNCTION int    remove(const char *path);

                template <typename Func>
                FUNCTION int    each(const char *path, Func);
                FUNCTION int    set_current(const char *path);
                FUNCTION int    get_current(char *path, size_t size);
                FUNCTION int    change_root(const char *path);

                CONSTRUCTOR Directory(const char *path);

                template <typename Func>
                METHOD int      list(Func);
{'fraction_non_alphanumeric': 0.07206317867719644, 'fraction_numerical': 0.007897334649555774, 'mean_word_length': 1.5460636515912898, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7511617', 'n_tokens_mistral': 835, 'n_tokens_neox': 729, 'n_words': 262}