MCPcopy Create free account
hub / github.com/SFML/SFML / makePermissions

Function makePermissions

src/SFML/Network/Sftp.cpp:101–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101int makePermissions(std::filesystem::perms permissions)
102{
103 int result{};
104 const auto add = [&](int i, std::filesystem::perms p)
105 { result |= (((permissions & p) == std::filesystem::perms::none) ? 0 : i); };
106 add(LIBSSH2_SFTP_S_IRUSR, std::filesystem::perms::owner_read);
107 add(LIBSSH2_SFTP_S_IWUSR, std::filesystem::perms::owner_write);
108 add(LIBSSH2_SFTP_S_IXUSR, std::filesystem::perms::owner_exec);
109 add(LIBSSH2_SFTP_S_IRGRP, std::filesystem::perms::group_read);
110 add(LIBSSH2_SFTP_S_IWGRP, std::filesystem::perms::group_write);
111 add(LIBSSH2_SFTP_S_IXGRP, std::filesystem::perms::group_exec);
112 add(LIBSSH2_SFTP_S_IROTH, std::filesystem::perms::others_read);
113 add(LIBSSH2_SFTP_S_IWOTH, std::filesystem::perms::others_write);
114 add(LIBSSH2_SFTP_S_IXOTH, std::filesystem::perms::others_exec);
115 return result;
116}
117
118sf::Sftp::Attributes makeAttributes(std::filesystem::path path, const LIBSSH2_SFTP_ATTRIBUTES& input)
119{

Callers 2

createDirectoryMethod · 0.85
uploadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected