31
Input/output library
[input.output]
31.12
File systems
[filesystems]
31.12.13
Filesystem operation functions
[fs.op.funcs]
31.12.13.20
Is empty
[fs.op.is.empty]
🔗
bool
filesystem
::
is_empty
(
const
path
&
p
)
;
bool
filesystem
::
is_empty
(
const
path
&
p, error_code
&
ec
)
;
1
#
Effects
:
(1.1)
Determine
file_
status s
, as if by
status
(
p
)
or
status
(
p, ec
)
, respectively
.
(1.2)
For the signature with argument
ec
, return
false
if an error occurred
.
(1.3)
Otherwise, if
is_
directory
(
s
)
:
(1.3.1)
Create a variable
itr
, as if by
directory_
iterator itr
(
p
)
or
directory_
iterator itr
(
p, ec
)
, respectively
.
(1.3.2)
For the signature with argument
ec
, return
false
if an error occurred
.
(1.3.3)
Otherwise, return
itr
=
=
directory_
iterator
(
)
.
(1.4)
Otherwise:
(1.4.1)
Determine
uintmax_
t sz
, as if by
file_
size
(
p
)
or
file_
size
(
p, ec
)
, respectively
.
(1.4.2)
For the signature with argument
ec
, return
false
if an error occurred
.
(1.4.3)
Otherwise, return
sz
=
=
0
.
2
#
Throws
: As specified in
[fs.
err.
report]
.