int main() {
 using namespace fs;
  // Default ctor
  {
    static_assert(std::is_nothrow_default_constructible<file_status>::value,
                  "The default constructor must be noexcept");
    static_assert(test_convertible<file_status>(),
                  "The default constructor must not be explicit");
    const file_status f;
    assert(f.type()  == file_type::none);
    assert(f.permissions() == perms::unknown);
  }

  // Unary ctor
  {
    static_assert(std::is_nothrow_constructible<file_status, file_type>::value,
                  "This constructor must be noexcept");
    static_assert(!test_convertible<file_status, file_type>(),
                 "This constructor must be explicit");

    const file_status f(file_type::not_found);
    assert(f.type()  == file_type::not_found);
    assert(f.permissions() == perms::unknown);
  }
  // Binary ctor
  {
    static_assert(std::is_nothrow_constructible<file_status, file_type, perms>::value,
                  "This constructor must be noexcept");
    static_assert(!test_convertible<file_status, file_type, perms>(),
                  "This constructor must b explicit");
    const file_status f(file_type::regular, perms::owner_read);
    assert(f.type()  == file_type::regular);
    assert(f.permissions() == perms::owner_read);
  }
}
Esempio n. 2
0
 inline bool type_present(file_status f) { return f.type() != status_error; }
Esempio n. 3
0
 inline bool status_known( file_status f ) { return f.type() != status_unknown; }
Esempio n. 4
0
 inline bool exists( file_status f )       { return f.type() != status_unknown && f.type() != file_not_found; }
 inline bool status_known(file_status f) { return f.type() != status_error; }
Esempio n. 6
0
 inline bool exists(file_status s) noexcept
 { return status_known(s) && s.type() != file_type::not_found; }
Esempio n. 7
0
 inline bool status_known(file_status s) noexcept
 { return s.type() != file_type::none; }
 inline bool is_symlink(file_status f)   { return f.type() == symlink_file; }
Esempio n. 9
0
 inline bool is_socket(file_status s) noexcept
 { return s.type() == file_type::socket; }
Esempio n. 10
0
 inline bool is_symlink(file_status s) noexcept
 { return s.type() == file_type::symlink; }
Esempio n. 11
0
 inline bool is_fifo(file_status s) noexcept
 { return s.type() == file_type::fifo; }
Esempio n. 12
0
 inline bool is_character_file(file_status s) noexcept
 { return s.type() == file_type::character; }
Esempio n. 13
0
 inline bool is_block_file(file_status s) noexcept
 { return s.type() == file_type::block; }
 inline bool exists(file_status f)       { return f.type() != status_error
                                               && f.type() != file_not_found; }
Esempio n. 15
0
 bool operator==(const file_status& rhs) const { return type() == rhs.type() && 
                                                 permissions() == rhs.permissions(); }
 inline bool is_directory(file_status f) { return f.type() == directory_file; }
Esempio n. 17
0
	inline bool is_directory(file_status s) noexcept
	{ return s.type() == file_type::directory ;}
 inline bool is_regular(file_status f)   { return f.type() == regular_file; }
Esempio n. 19
0
	inline bool is_regular_file(file_status s) noexcept
	{
		return s.type() == file_type::regular;
	}
Status::Status(const file_status &Status)
    : UID(Status.getUniqueID()), MTime(Status.getLastModificationTime()),
      User(Status.getUser()), Group(Status.getGroup()), Size(Status.getSize()),
      Type(Status.type()), Perms(Status.permissions()) {}
Esempio n. 21
0
 bool exists(file_status status) noexcept
 {
   return status.type() != file_type::not_found;
 }