File: pathmembers.yo

package info (click to toggle)
c%2B%2B-annotations 13.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,576 kB
  • sloc: cpp: 25,297; makefile: 1,523; ansic: 165; sh: 126; perl: 90; fortran: 27
file content (136 lines) | stat: -rw-r--r-- 6,366 bytes parent folder | download | duplicates (2)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
    bf(Operators:)
    itemization(
    itt(path &operator/=(Type const &arg)):nl()
       the arguments that can be passed to constructors can also be passed
        to this member. The tt(arg) argument is separated from the path's
        current content by a directory separator (unless the path is initially
        empty as in tt(cout << path{}.append("entry"))). See also the members
        tt(append) and tt(concat), below. The free operator tt(/) accepts two
        tt(path) (promotable) arguments, returning a tt(path) containing both
        paths separated by a directory separator (e.g., tt(lhs / rhs) returns
        the tt(path) object tt(lhs/rhs));

    itt(path &operator+=(Type const &arg)):nl()
       similar to tt(/=), but em(no) directory separator is used when
        adding tt(arg) to the current tt(path);

    it() comparison operators: tt(path) objects can be compared using the
        (operators implied by the) tt(==) and tt(<=>) operators. Path objects
        are compared by lexicographical comparing their ascii-character
        content;

    itt(ostream &operator<<(ostream &out, path const &path)) (stream
        insertion) inserts tt(path's) content, surrounded by double quotes,
        into tt(out);

    itt(istream &operator>>(istream &in, path &path)) extracts
        tt(path's) content from tt(in). The extracted path name may optionally
        be surrounded by double quotes. When inserting a previously extracted
        tt(path) object only one set of surrounding quotes are shown.
    )

    bf(Accessors:) 

    Accessors return specific tt(path) components. If a path doesn't contain
    the requested component then an empty tt(path) is returned.
    itemization(
    itt(char const *c_str()): the path's content is returned as an NTBS; 

    itt(path extension()) returns the dot-extension of the path's last
        component (including the dot);

    itt(path filename()) returns the last path-content of the current tt(path)
        object. See also the tt(stem()) accessor, below;

    itt(bool is_absolute()): returns tt(true) if the tt(path) object contains
        an absolute path specification;

    itt(bool is_relative()): returns tt(true) if the tt(path) object contains
        a relative path specification;

    itt(path parent_path()) returns the current path-content from which the
        last element has been removed. Note that if the tt(path) object
        contains a filename's path (like tt("/usr/bin/zip")) then
        tt(parent_path) removes tt(/zip) and returns tt(/usr/bin), so not
        tt(zip's) parent directory, but its actual directory;

    itt(path relative_path()): returns the path's content beyond
        the path's root-directory component of the tt(path) object. E.g., if
        the tt(path ulb{ "/usr/local/bin" }) is defined then
        tt(ulb.relative_path()) returns a path containing tt("usr/local/bin");

    itt(path root_directory()): returns the root-directory component of the
        tt(path) object;

    itt(path root_name()): returns the root-name's component of the tt(path)
        object;

    itt(path root_path()): returns the root-path component of the tt(path)
        object;

    itt(path stem()) returns the last path-content of the current tt(path)
        object from which the dot-extension hash been removed;

    itt(string()): returns the path's content as a tt(std::string).nl()
       Similar accessors are available for the following string-types:
        tt(wstring, u8string, u16string, , u32string, generic_string,
        generic_wstring, generic_u8string, generic_u16string,) and
        tt(generic_u32string);
    )

    Except for the family of tt(string()) and the tt(is_...) accessors, there
    are also tt(bool has_...) members returning tt(true) if the tt(path)
    contains the specified component (e.g., tt(has_extension) returns tt(true)
    if the tt(path) contains an extension).

    bf(Member functions:)
    itemization(
    itt(path &append(Type const &arg)) acts like the tt(/=) operator;
        
    itt(path::iterator begin()) returns an iterator containing the first path
        component; Dereferencing a tt(path::iterator) returns a tt(path)
        object.nl()
       When available root names and root directories are returned as initial
        components. When incrementing tt(path::iterators) the individual
        directories and finally filename components are returned. The
        directory separators themselves are not returned when dereferencing
        subsequent tt(path::iterators);

    itt(path::const_iterator begin() const) returns a iterator to the
        immutable first path component; Dereferencing a
        tt(path::const_iterator) returns a tt(path const) object;

    itt(void clear()): the tt(path's) content is erased;

    itt(int compare(Type const &other)):nl()
       returns the result of lexicographically comparing the current path's
        content with tt(other). tt(Other) can be a tt(path), a string-type or
        an NTBS;

    itt(path &concat(Type const &arg)) acts like the tt(+=) operator;

    itt(path::iterator end()) returns an iterator beyond the last path
        component;

    itt(path::const_iterator end() const) returns an iterator beyond the
        immutable last path component 

    itt(path &remove_filename()):nl()
       removes the last component of the stored path not ending in tt(/). If
        the tt(path) doesn't contain a slash then the tt(path) object's
        cleared;

    itt(path &replace_extension(path const &replacement = path{} )):nl()
       replaces the extension of the last component of the stored path
        (including the extension's dot) with tt(replacement). The extension is
        removed if tt(replacement) is empty. If the tt(path) calling
        tt(replace_extension) has no extension then tt(replacement) is added.
        The replacement may optionally start with a dot. The path object's
        extension receives only one dot;

    itt(path &replace_filename(path const &replacement)):nl()
       replaces the last component of the stored path with tt(replacement),
        which itself may contain multiple path elements.  If only a
        root-directory is stored, then it is replaced by tt(replacement). The
        member's behavior is undefined if the current path object is empty;
    )