From d2f2371de43ca4e3e844d7e9db03bb4eac89cfaf Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 1 Jan 2006 14:23:09 +0000 Subject: [PATCH] Add predicate function overloads on status_flags (Suggested by Martin Adrian) [SVN r32196] --- doc/operations.htm | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/doc/operations.htm b/doc/operations.htm index f4ca519..fecae7e 100644 --- a/doc/operations.htm +++ b/doc/operations.htm @@ -22,7 +22,8 @@     "Do-the-right-thing" rule
    status
    exists
-    is_directory
+    is_error
+    is_directory
    is_file
    is_symlink
    is_empty
@@ -145,10 +146,16 @@ header.

template<class Path> status_flags status( const Path & ph, const symlink_t &, system_error_type * ec = 0 ); template<class Path> bool exists( const Path & ph ); + bool exists( status_flags f ); + bool is_error( status_flags f ); template<class Path> bool is_directory( const Path & ph ); + bool is_directory( status_flags f ); template<class Path> bool is_file( const Path & ph ); + bool is_file( status_flags f ); template<class Path> bool is_other( const Path & ph ); + bool is_other( status_flags f ); template<class Path> bool is_symlink( const Path & ph ); + bool is_symlink( status_flags f ); template<class Path> bool is_empty( const Path & ph ); template<class Path> bool equivalent( const Path & ph1, const Path & ph2 ); template<class Path> boost::intmax_t file_size( const Path & ph ); @@ -405,24 +412,44 @@ will be portable to systems like POSIX, where symbolic links may be present.

template<class Path> bool exists( const Path & ph );

Throws: If status(ph) == error_flag.

Returns: status(ph) != not_found_flag

+

bool is_exists( status_flags f );

+

Returns: + + f != 0 && ((f & + not_found_flag) == 0)

+ +

is_error

+
+
bool is_error( status_flags f );
+

Returns: + (f & error_flag) != 0

is_directory

template<class Path> bool is_directory( const Path & ph );

Throws: If status(ph) == error_flag.

Returns: (status(ph) & directory_flag) != 0

+
bool is_directory( status_flags f );
+

Returns: (f & + directory_flag) != 0

is_file

template<class Path> bool is_file( const Path & ph );

Throws: If status(ph) == error_flag.

Returns: (status(ph) & file_flag) != 0

+
bool is_file( status_flags f );
+

Returns: (f & + file_flag) != 0

is_other

template<class Path> bool is_other( const Path & ph );

Throws: If status(ph) == error_flag.

Returns: (status(ph) & other_flag) != 0

+
bool is_other( status_flags f );
+

Returns: (f & + other_flag) != 0

is_symlink

@@ -432,6 +459,9 @@ template<class DirItr> bool is_symlink( const DirItr & ph );

Throws: If symlink_status(ph) == error_flag.

Returns: symlink_status(ph) == symlink_flag)

+
bool is_symlink( status_flags f );
+

Returns: (f & + symlink_flag) != 0

is_empty

@@ -819,7 +849,7 @@ by a prior program run by the command processor.


Revised -28 December, 2005

+01 January, 2006

© Copyright Beman Dawes, 2002

Use, modification, and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file