Files
seadisk/include/seafile/api/file_info.hpp
T
2026-07-14 21:28:08 +08:00

75 lines
1.7 KiB
C++

//
// Created by Shell on 2026-06-18.
//
#ifndef SEADISK_FILE_INFO_HPP
#define SEADISK_FILE_INFO_HPP
#include <cstdint>
#include <string>
#include <nlohmann/json.hpp>
namespace seafile::api
{
/**
* @brief Detailed file metadata.
*/
struct FileInfo final
{
/// Object type, usually "file".
std::string type;
/// File object identifier.
std::string id;
/// File name.
std::string name;
/// Current user's permission (e.g. "r", "rw").
std::string permission;
/// Last modification time (Unix timestamp, seconds).
std::int64_t mtime{};
/// Last modification time in ISO 8601 format.
std::string last_modified;
/// Internal email address of the last modifier.
std::string last_modifier_email;
/// Display name of the last modifier.
std::string last_modifier_name;
/// Contact email address of the last modifier.
std::string last_modifier_contact_email;
/// File size in bytes.
std::uint64_t size{};
/// Whether the file is starred by the current user.
bool starred{};
/// Total number of comments.
std::uint32_t comment_total{};
/// Whether the current user can edit the file.
bool can_edit{};
NLOHMANN_DEFINE_TYPE_INTRUSIVE(
FileInfo,
type,
id,
name,
permission,
mtime,
last_modified,
last_modifier_email,
last_modifier_name,
last_modifier_contact_email,
size,
starred,
comment_total,
can_edit)
};
}
#endif //SEADISK_FILE_INFO_HPP