File: PathPattern.h

package info (click to toggle)
lsp-plugins 1.2.21-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 120,408 kB
  • sloc: cpp: 589,849; xml: 74,078; makefile: 13,396; php: 1,268; sh: 185
file content (95 lines) | stat: -rw-r--r-- 4,197 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
 * Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/>
 *           (C) 2025 Vladimir Sadovnikov <sadko4u@gmail.com>
 *
 * This file is part of lsp-tk-lib
 * Created on: 21 окт. 2020 г.
 *
 * lsp-tk-lib is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * lsp-tk-lib is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with lsp-tk-lib. If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef LSP_PLUG_IN_TK_PROP_SIMPLE_PATHPATTERN_H_
#define LSP_PLUG_IN_TK_PROP_SIMPLE_PATHPATTERN_H_

#ifndef LSP_PLUG_IN_TK_IMPL
    #error "use <lsp-plug.in/tk/tk.h>"
#endif

#include <lsp-plug.in/io/PathPattern.h>

namespace lsp
{
    namespace tk
    {
        /**
         * File pattern: specifies the file pattern to match file names
         */
        class PathPattern: public Property
        {
            protected:
                io::PathPattern                 sPattern;

            protected:
                explicit PathPattern(prop::Listener *listener = NULL);
                PathPattern(const PathPattern &) = delete;
                PathPattern(PathPattern &&) = delete;
                virtual ~PathPattern() override;

                PathPattern & operator = (const PathPattern &) = delete;
                PathPattern & operator = (PathPattern &&);

            public:
                const io::PathPattern          *pattern() const     { return &sPattern;             }
                const LSPString                *get() const         { return sPattern.get();        }
                const char                     *get_utf8() const    { return sPattern.get_utf8();   }
                inline size_t                   flags() const       { return sPattern.flags();      }

                inline bool                     test(const char *path) const        { return sPattern.test(path);       }
                inline bool                     test(const LSPString *path) const   { return sPattern.test(path);       }
                inline bool                     test(const io::Path *path) const    { return sPattern.test(path);       }

                status_t                        set(const io::PathPattern *pattern, size_t flags = 0);
                status_t                        set(const LSPString *pattern, size_t flags = 0);
                status_t                        set(const io::Path *pattern, size_t flags = 0);
                status_t                        set(const char *pattern, size_t flags = 0);

                status_t                        set_pattern(const io::PathPattern *pattern);
                status_t                        set_pattern(const LSPString *pattern);
                status_t                        set_pattern(const io::Path *pattern);
                status_t                        set_pattern(const char *pattern);

                size_t                          set_flags(size_t flags);

                void                            swap(PathPattern *src);
                inline void                     swap(PathPattern &src)              { swap(&src);                       }
        };

        namespace prop
        {
            class PathPattern: public tk::PathPattern
            {
                public:
                    explicit PathPattern(prop::Listener *listener = NULL): tk::PathPattern(listener) {};
                    PathPattern(const PathPattern &) = delete;
                    PathPattern(PathPattern &&) = delete;

                    PathPattern & operator = (const PathPattern &) = delete;
                    PathPattern & operator = (PathPattern &&);
            };

        } /* namespace prop */
    } /* namespace tk */
} /* namespace lsp */

#endif /* LSP_PLUG_IN_TK_PROP_SIMPLE_PATHPATTERN_H_ */