You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
falk-werner_webfuse/src/webfuse/ws/messagereader.hpp

54 lines
1.1 KiB

#ifndef WEBFUSE_MESSAGEREADER_HPP
#define WEBFUSE_MESSAGEREADER_HPP
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <unistd.h>
#include <cinttypes>
#include <string>
#include <vector>
namespace webfuse
{
class messagereader
{
messagereader(messagereader const &) = delete;
messagereader& operator=(messagereader const &) = delete;
public:
explicit messagereader(std::string & value);
~messagereader() = default;
messagereader(messagereader && other);
messagereader& operator=(messagereader && other);
int read_result();
void read_attr(struct stat * attr);
void read_statistics(struct statvfs * statistics);
int read_access_mode();
mode_t read_mode();
bool read_bool();
uint8_t read_u8();
uint32_t read_u32();
uint64_t read_u64();
int32_t read_i32();
std::string read_str();
std::string read_bytes();
void read_strings(std::vector<std::string> &entries);
void read_time(struct timespec &time);
int read_openflags();
private:
std::string data;
size_t pos;
};
}
#endif