mirror of
https://github.com/falk-werner/webfuse
synced 2026-03-02 03:40:24 +00:00
removed obsolete files
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
#include "webfuse/filesystem/fileattributes.hpp"
|
||||
|
||||
namespace webfuse
|
||||
{
|
||||
|
||||
file_attributes::file_attributes()
|
||||
: inode(0)
|
||||
, nlink(0)
|
||||
, rdev(0)
|
||||
, size(0)
|
||||
, blocks(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
file_attributes::file_attributes(struct stat const & other)
|
||||
{
|
||||
inode = static_cast<uint64_t>(other.st_ino);
|
||||
nlink = static_cast<uint64_t>(other.st_nlink);
|
||||
mode = filemode::from_mode(other.st_mode);
|
||||
uid = user_id::from_uid(other.st_uid);
|
||||
gid = group_id::from_gid(other.st_gid);
|
||||
rdev = static_cast<uint64_t>(other.st_rdev);
|
||||
size = static_cast<uint64_t>(other.st_size);
|
||||
blocks = static_cast<uint64_t>(other.st_blocks);
|
||||
atime = filetime::from_timespec(other.st_atim);
|
||||
mtime = filetime::from_timespec(other.st_mtim);
|
||||
ctime = filetime::from_timespec(other.st_ctim);
|
||||
}
|
||||
|
||||
void file_attributes::to_stat(struct stat & other) const
|
||||
{
|
||||
other.st_ino = inode;
|
||||
other.st_nlink = nlink;
|
||||
other.st_mode = mode.to_mode();
|
||||
other.st_uid = uid.to_uid();
|
||||
other.st_gid = gid.to_gid();
|
||||
other.st_rdev = rdev;
|
||||
other.st_size = size;
|
||||
other.st_blocks = blocks;
|
||||
atime.to_timespec(other.st_atim);
|
||||
mtime.to_timespec(other.st_mtim);
|
||||
ctime.to_timespec(other.st_ctim);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
#ifndef WEBFUSE_FILEATTRIBUTES_HPP
|
||||
#define WEBFUSE_FILEATTRIBUTES_HPP
|
||||
|
||||
#include "webfuse/filesystem/filemode.hpp"
|
||||
#include "webfuse/filesystem/filetime.hpp"
|
||||
#include "webfuse/filesystem/userid.hpp"
|
||||
#include "webfuse/filesystem/groupid.hpp"
|
||||
#include <sys/stat.h>
|
||||
#include <cinttypes>
|
||||
|
||||
namespace webfuse
|
||||
{
|
||||
|
||||
class file_attributes
|
||||
{
|
||||
public:
|
||||
file_attributes();
|
||||
|
||||
explicit file_attributes(struct stat const & other);
|
||||
void to_stat(struct stat & other) const;
|
||||
|
||||
uint64_t inode;
|
||||
uint64_t nlink;
|
||||
filemode mode;
|
||||
user_id uid;
|
||||
group_id gid;
|
||||
uint64_t rdev;
|
||||
uint64_t size;
|
||||
uint64_t blocks;
|
||||
filetime atime;
|
||||
filetime mtime;
|
||||
filetime ctime;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,16 +0,0 @@
|
||||
#ifndef WEBFUSE_FILEHANDLE_HPP
|
||||
#define WEBFUSE_FILEHANDLE_HPP
|
||||
|
||||
#include <cinttypes>
|
||||
|
||||
namespace webfuse
|
||||
{
|
||||
|
||||
using filehandle = uint64_t;
|
||||
|
||||
constexpr filehandle const invalid_handle = (filehandle) -1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,43 +0,0 @@
|
||||
#include "webfuse/filesystem/filetime.hpp"
|
||||
|
||||
namespace webfuse
|
||||
{
|
||||
|
||||
filetime::filetime()
|
||||
: seconds(0)
|
||||
, nsec(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
filetime filetime::from_timespec(timespec const & other)
|
||||
{
|
||||
filetime result;
|
||||
result.seconds = static_cast<uint64_t>(other.tv_sec);
|
||||
result.nsec = static_cast<uint32_t>(other.tv_nsec);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
filetime filetime::from_time(time_t const & other)
|
||||
{
|
||||
filetime result;
|
||||
result.seconds = static_cast<uint64_t>(other);
|
||||
result.nsec = 0;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void filetime::to_timespec(timespec & other) const
|
||||
{
|
||||
other.tv_sec = seconds;
|
||||
other.tv_nsec = static_cast<time_t>(nsec);
|
||||
}
|
||||
|
||||
time_t filetime::to_time() const
|
||||
{
|
||||
return static_cast<time_t>(seconds);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#ifndef WEBFUSE_FILETIME_HPP
|
||||
#define WEBFUSE_FILETIME_HPP
|
||||
|
||||
#include <ctime>
|
||||
#include <cinttypes>
|
||||
|
||||
namespace webfuse
|
||||
{
|
||||
|
||||
class filetime
|
||||
{
|
||||
public:
|
||||
filetime();
|
||||
static filetime from_timespec(timespec const & other);
|
||||
static filetime from_time(time_t const & other);
|
||||
void to_timespec(timespec & other) const;
|
||||
time_t to_time() const;
|
||||
|
||||
uint64_t seconds;
|
||||
uint32_t nsec;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,27 +0,0 @@
|
||||
#include "webfuse/filesystem/groupid.hpp"
|
||||
|
||||
namespace webfuse
|
||||
{
|
||||
|
||||
group_id::group_id(uint32_t value)
|
||||
: value_(value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
group_id::operator uint32_t() const
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
group_id group_id::from_gid(gid_t value)
|
||||
{
|
||||
return group_id(static_cast<uint32_t>(value));
|
||||
}
|
||||
|
||||
gid_t group_id::to_gid() const
|
||||
{
|
||||
return static_cast<gid_t>(value_);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#ifndef WEBFUSE_GROUPID_HPP
|
||||
#define WEBFUSE_GROUPID_HPP
|
||||
|
||||
#include <unistd.h>
|
||||
#include <cinttypes>
|
||||
|
||||
namespace webfuse
|
||||
{
|
||||
|
||||
class group_id
|
||||
{
|
||||
public:
|
||||
static constexpr uint32_t const invalid = (uint32_t) -1;
|
||||
|
||||
explicit group_id(uint32_t value = invalid);
|
||||
operator uint32_t() const;
|
||||
static group_id from_gid(gid_t value);
|
||||
gid_t to_gid() const;
|
||||
private:
|
||||
uint32_t value_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,28 +0,0 @@
|
||||
#include "webfuse/filesystem/userid.hpp"
|
||||
|
||||
namespace webfuse
|
||||
{
|
||||
|
||||
user_id::user_id(uint32_t value)
|
||||
: value_(value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
user_id::operator uint32_t() const
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
user_id user_id::from_uid(uid_t value)
|
||||
{
|
||||
return user_id(static_cast<uint32_t>(value));
|
||||
}
|
||||
|
||||
uid_t user_id::to_uid() const
|
||||
{
|
||||
return static_cast<uid_t>(value_);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
#ifndef WEBFUSE_USERID_HPP
|
||||
#define WEBFUSE_USERID_HPP
|
||||
|
||||
#include <unistd.h>
|
||||
#include <cinttypes>
|
||||
|
||||
namespace webfuse
|
||||
{
|
||||
|
||||
class user_id
|
||||
{
|
||||
public:
|
||||
static constexpr uint32_t const invalid = (uint32_t) -1;
|
||||
|
||||
explicit user_id(uint32_t value = invalid);
|
||||
operator uint32_t() const;
|
||||
static user_id from_uid(uid_t value);
|
||||
uid_t to_uid() const;
|
||||
private:
|
||||
uint32_t value_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "webfuse/ws/messagereader.hpp"
|
||||
#include "webfuse/filesystem/status.hpp"
|
||||
#include "webfuse/filesystem/fileattributes.hpp"
|
||||
#include "webfuse/filesystem/filemode.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
Reference in New Issue
Block a user