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);
  }
}
Exemplo n.º 2
0
 inline bool type_present(file_status f) { return f.type() != status_error; }
Exemplo n.º 3
0
 inline bool status_known( file_status f ) { return f.type() != status_unknown; }
Exemplo 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; }
Exemplo n.º 6
0
 inline bool exists(file_status s) noexcept
 { return status_known(s) && s.type() != file_type::not_found; }
Exemplo 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; }
Exemplo n.º 9
0
 inline bool is_socket(file_status s) noexcept
 { return s.type() == file_type::socket; }
Exemplo n.º 10
0
 inline bool is_symlink(file_status s) noexcept
 { return s.type() == file_type::symlink; }
Exemplo n.º 11
0
 inline bool is_fifo(file_status s) noexcept
 { return s.type() == file_type::fifo; }
Exemplo n.º 12
0
 inline bool is_character_file(file_status s) noexcept
 { return s.type() == file_type::character; }
Exemplo 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; }
Exemplo 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; }
Exemplo 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; }
Exemplo n.º 19
0
	inline bool is_regular_file(file_status s) noexcept
	{
		return s.type() == file_type::regular;
	}
Exemplo n.º 20
0
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()) {}
Exemplo n.º 21
0
 bool exists(file_status status) noexcept
 {
   return status.type() != file_type::not_found;
 }