File indexing completed on 2025-01-18 09:55:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef DAVIX_FILE_TYPES_HPP
0023 #define DAVIX_FILE_TYPES_HPP
0024
0025 #include <memory>
0026 #include <utils/davix_types.hpp>
0027 #include <utils/davix_uri.hpp>
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 struct Davix_dir_handle;
0040 struct Davix_fd;
0041
0042 typedef struct Davix_dir_handle DAVIX_DIR;
0043 typedef struct Davix_fd DAVIX_FD;
0044
0045 namespace Davix{
0046
0047
0048
0049
0050 struct DAVIX_EXPORT DavIOVecInput{
0051 void* diov_buffer;
0052 dav_off_t diov_offset;
0053 dav_size_t diov_size;
0054 };
0055
0056
0057
0058 struct DAVIX_EXPORT DavIOVecOuput{
0059 void* diov_buffer;
0060 dav_ssize_t diov_size;
0061 };
0062
0063
0064
0065
0066
0067
0068
0069 enum DAVIX_EXPORT advise_t{
0070 AdviseAuto=0x00,
0071 AdviseSequential,
0072 AdviseRandom,
0073
0074 };
0075
0076
0077
0078
0079
0080
0081
0082 class QuotaInfoHandler;
0083
0084 class QuotaInfo {
0085 friend class QuotaInfoHandler;
0086 public:
0087 struct Internal;
0088 QuotaInfo();
0089 ~QuotaInfo();
0090 dav_size_t getUsedBytes();
0091 dav_size_t getFreeSpace();
0092 private:
0093 std::shared_ptr<Internal> d_ptr;
0094 };
0095
0096
0097
0098
0099
0100
0101
0102 struct StatInfo{
0103 StatInfo(): size(0), nlink(0), mode(0), atime(0), mtime(0), ctime(0), owner(0), group(0) {
0104 }
0105
0106
0107 dav_size_t size;
0108
0109
0110 dav_ssize_t nlink;
0111
0112
0113 mode_t mode;
0114
0115 time_t atime;
0116
0117 time_t mtime;
0118
0119 time_t ctime;
0120
0121 uid_t owner;
0122
0123 gid_t group;
0124
0125
0126 inline void fromPosixStat(const struct stat & st){
0127 mode = static_cast<mode_t>(st.st_mode);
0128 atime = static_cast<time_t>(st.st_atime);
0129 mtime = static_cast<time_t>(st.st_mtime);
0130 ctime = static_cast<time_t>(st.st_ctime);
0131 size = static_cast<dav_size_t>(st.st_size);
0132 nlink = static_cast<dav_size_t>(st.st_nlink);
0133 owner = static_cast<uid_t>(st.st_uid);
0134 group = static_cast<gid_t>(st.st_gid);
0135 }
0136
0137
0138 inline struct stat & toPosixStat(struct stat & st){
0139 st.st_mode = static_cast<mode_t>(mode);
0140 st.st_atime = static_cast<time_t>(atime);
0141 st.st_mtime = static_cast<time_t>(mtime);
0142 st.st_ctime = static_cast<time_t>(ctime);
0143 st.st_size = static_cast<off_t>(size);
0144 st.st_nlink = static_cast<nlink_t>(nlink);
0145 st.st_uid = static_cast<uid_t>(owner);
0146 st.st_gid = static_cast<gid_t>(group);
0147 return st;
0148 }
0149 };
0150
0151
0152
0153 }
0154
0155
0156 #endif