Loading cmake/FindExpand.cmake +10 −3 Original line number Original line Diff line number Diff line Loading @@ -29,23 +29,28 @@ find_path(Expand_INCLUDE_DIR find_path(Expand_INCLUDE_DIR NAMES xpn.h NAMES xpn.h PREFIX xpn PREFIX xpn_client ) ) find_library(Expand_LIBRARY find_library(Expand_LIBRARY NAMES libxpn.so NAMES libxpn.so ) ) find_library(Expand_LIBRARY_BY NAMES xpn_bypass.so ) include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs) find_package_handle_standard_args( find_package_handle_standard_args( Expand Expand DEFAULT_MSG DEFAULT_MSG Expand_INCLUDE_DIR Expand_INCLUDE_DIR Expand_LIBRARY Expand_LIBRARY Expand_LIBRARY_BY ) ) if(Expand_FOUND) if(Expand_FOUND) set(Expand_LIBRARIES ${Expand_LIBRARY}) set(Expand_LIBRARIES ${Expand_LIBRARY} ${Expand_LIBRARY_BY}) set(Expand_INCLUDE_DIRS ${Expand_INCLUDE_DIR}) set(Expand_INCLUDE_DIRS ${Expand_INCLUDE_DIR}) Loading @@ -53,6 +58,7 @@ if(Expand_FOUND) add_library(Expand::Expand UNKNOWN IMPORTED) add_library(Expand::Expand UNKNOWN IMPORTED) set_target_properties(Expand::Expand PROPERTIES set_target_properties(Expand::Expand PROPERTIES IMPORTED_LOCATION "${Expand_LIBRARY}" IMPORTED_LOCATION "${Expand_LIBRARY}" IMPORTED_LOCATION "${Expand_LIBRARY_BY}" INTERFACE_INCLUDE_DIRECTORIES "${Expand_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${Expand_INCLUDE_DIR}" ) ) endif() endif() Loading @@ -62,4 +68,5 @@ endif() mark_as_advanced( mark_as_advanced( Expand_INCLUDE_DIR Expand_INCLUDE_DIR Expand_LIBRARY Expand_LIBRARY Expand_LIBRARY_BY ) ) src/posix_file/posix_file/fs_plugin/expand_plugin.cpp +35 −3 Original line number Original line Diff line number Diff line Loading @@ -7,7 +7,7 @@ extern "C" { extern "C" { #endif #endif #include "xpn.h" #include <xpn_client/xpn.h> #ifdef __cplusplus #ifdef __cplusplus } } Loading @@ -32,7 +32,7 @@ expand_plugin::~expand_plugin() { // Override the open function // Override the open function int int expand_plugin::open(const std::string& path, int flags, unsigned int mode) { expand_plugin::open(const std::string& path, int flags, unsigned int mode) { return xpn_open(path, flags, mode); return xpn_open(path.c_str(), flags, mode); } } // Override the pread function // Override the pread function Loading @@ -52,7 +52,7 @@ expand_plugin::pwrite(int fd, const void* buf, size_t count, off_t offset) { bool bool expand_plugin::mkdir(const std::string& path, mode_t mode) { expand_plugin::mkdir(const std::string& path, mode_t mode) { int result = xpn_mkdir(path, mode); int result = xpn_mkdir(path.c_str(), mode); return result; return result; } } Loading @@ -74,4 +74,36 @@ expand_plugin::fallocate(int fd, int mode, off_t offset, off_t len) { (void) len; (void) len; return len; return len; } } int expand_plugin::unlink(const std::string& path) { (void) path; std::cerr << "expand_plugin unlink not supported" << std::endl; return 0; } std::vector<std::string> expand_plugin::readdir(const std::string& path) { (void) path; std::cerr << "expand_plugin readdir not supported" << std::endl; return {}; } // stat int expand_plugin::stat(const std::string& path, struct stat* buf) { (void) path; (void) buf; std::cerr << "expand_plugin stat not supported" << std::endl; return 0; } ssize_t expand_plugin::size(const std::string& path) { (void) path; std::cerr << "expand_plugin size not supported" << std::endl; return 0; } } // namespace cargo } // namespace cargo No newline at end of file src/posix_file/posix_file/fs_plugin/expand_plugin.hpp +8 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,14 @@ public: lseek(int fd, off_t offset, int whence) final; lseek(int fd, off_t offset, int whence) final; off_t off_t fallocate(int fd, int mode, off_t offset, off_t len) final; fallocate(int fd, int mode, off_t offset, off_t len) final; std::vector<std::string> readdir(const std::string& path) final; int unlink(const std::string& path) final; int stat(const std::string& path, struct stat* buf) final; ssize_t size(const std::string& path) final; }; }; }; // namespace cargo }; // namespace cargo Loading Loading
cmake/FindExpand.cmake +10 −3 Original line number Original line Diff line number Diff line Loading @@ -29,23 +29,28 @@ find_path(Expand_INCLUDE_DIR find_path(Expand_INCLUDE_DIR NAMES xpn.h NAMES xpn.h PREFIX xpn PREFIX xpn_client ) ) find_library(Expand_LIBRARY find_library(Expand_LIBRARY NAMES libxpn.so NAMES libxpn.so ) ) find_library(Expand_LIBRARY_BY NAMES xpn_bypass.so ) include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs) find_package_handle_standard_args( find_package_handle_standard_args( Expand Expand DEFAULT_MSG DEFAULT_MSG Expand_INCLUDE_DIR Expand_INCLUDE_DIR Expand_LIBRARY Expand_LIBRARY Expand_LIBRARY_BY ) ) if(Expand_FOUND) if(Expand_FOUND) set(Expand_LIBRARIES ${Expand_LIBRARY}) set(Expand_LIBRARIES ${Expand_LIBRARY} ${Expand_LIBRARY_BY}) set(Expand_INCLUDE_DIRS ${Expand_INCLUDE_DIR}) set(Expand_INCLUDE_DIRS ${Expand_INCLUDE_DIR}) Loading @@ -53,6 +58,7 @@ if(Expand_FOUND) add_library(Expand::Expand UNKNOWN IMPORTED) add_library(Expand::Expand UNKNOWN IMPORTED) set_target_properties(Expand::Expand PROPERTIES set_target_properties(Expand::Expand PROPERTIES IMPORTED_LOCATION "${Expand_LIBRARY}" IMPORTED_LOCATION "${Expand_LIBRARY}" IMPORTED_LOCATION "${Expand_LIBRARY_BY}" INTERFACE_INCLUDE_DIRECTORIES "${Expand_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${Expand_INCLUDE_DIR}" ) ) endif() endif() Loading @@ -62,4 +68,5 @@ endif() mark_as_advanced( mark_as_advanced( Expand_INCLUDE_DIR Expand_INCLUDE_DIR Expand_LIBRARY Expand_LIBRARY Expand_LIBRARY_BY ) )
src/posix_file/posix_file/fs_plugin/expand_plugin.cpp +35 −3 Original line number Original line Diff line number Diff line Loading @@ -7,7 +7,7 @@ extern "C" { extern "C" { #endif #endif #include "xpn.h" #include <xpn_client/xpn.h> #ifdef __cplusplus #ifdef __cplusplus } } Loading @@ -32,7 +32,7 @@ expand_plugin::~expand_plugin() { // Override the open function // Override the open function int int expand_plugin::open(const std::string& path, int flags, unsigned int mode) { expand_plugin::open(const std::string& path, int flags, unsigned int mode) { return xpn_open(path, flags, mode); return xpn_open(path.c_str(), flags, mode); } } // Override the pread function // Override the pread function Loading @@ -52,7 +52,7 @@ expand_plugin::pwrite(int fd, const void* buf, size_t count, off_t offset) { bool bool expand_plugin::mkdir(const std::string& path, mode_t mode) { expand_plugin::mkdir(const std::string& path, mode_t mode) { int result = xpn_mkdir(path, mode); int result = xpn_mkdir(path.c_str(), mode); return result; return result; } } Loading @@ -74,4 +74,36 @@ expand_plugin::fallocate(int fd, int mode, off_t offset, off_t len) { (void) len; (void) len; return len; return len; } } int expand_plugin::unlink(const std::string& path) { (void) path; std::cerr << "expand_plugin unlink not supported" << std::endl; return 0; } std::vector<std::string> expand_plugin::readdir(const std::string& path) { (void) path; std::cerr << "expand_plugin readdir not supported" << std::endl; return {}; } // stat int expand_plugin::stat(const std::string& path, struct stat* buf) { (void) path; (void) buf; std::cerr << "expand_plugin stat not supported" << std::endl; return 0; } ssize_t expand_plugin::size(const std::string& path) { (void) path; std::cerr << "expand_plugin size not supported" << std::endl; return 0; } } // namespace cargo } // namespace cargo No newline at end of file
src/posix_file/posix_file/fs_plugin/expand_plugin.hpp +8 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,14 @@ public: lseek(int fd, off_t offset, int whence) final; lseek(int fd, off_t offset, int whence) final; off_t off_t fallocate(int fd, int mode, off_t offset, off_t len) final; fallocate(int fd, int mode, off_t offset, off_t len) final; std::vector<std::string> readdir(const std::string& path) final; int unlink(const std::string& path) final; int stat(const std::string& path, struct stat* buf) final; ssize_t size(const std::string& path) final; }; }; }; // namespace cargo }; // namespace cargo Loading