📄 wyfilehandle.h
字号:
/* Copyright is licensed under GNU LGPL. by I.J.Wang 2003*/#ifndef WYFILEHANDLE_H__#define WYFILEHANDLE_H__#define WYFILEHANDLE_VERSION 31#include "wyfilestat.h"/* WyFileHandle is a class for file descriptor (file handle)*/class WyFileHandle { public: static const char class_name[]; WyFileHandle() WY__TSPC() : _fd(WY__DEFAULT_FD) {}; WyFileHandle(const WyFileHandle &src) WY__TSPC() { _fd=src._fd; }; // Note: Wy__TypeFD is type int // Note: This member takes any fd // explicit WyFileHandle(Wy__TypeFD fd) WY__TSPC() : _fd(fd) {}; WyFileHandle(WyFileHandle& src, Wy::ByMove_t) WY__TSPC() { _fd=src._fd; }; // self copy ok bool is_default(void) const WY__TSPC() { return _fd==WY__DEFAULT_FD; }; Wy__TypeFD fd(void) const WY__TSPC() { return _fd; }; WyRet stat(WyFileStat& filestat) const; void reset(void) WY__TSPC() { _fd=WY__DEFAULT_FD; }; void reset(const WyFileHandle& src) WY__TSPC() { _fd=src._fd; }; void reset(Wy__TypeFD fd) WY__TSPC() { _fd=fd; }; const WyFileHandle& operator =(const WyFileHandle& src) WY__TSPC() { _fd=src._fd; return(*this); }; const WyFileHandle& operator =(Wy__TypeFD fd) WY__TSPC() { _fd=fd; return(*this); }; bool operator==(const WyFileHandle& rhs) const WY__TSPC() { return _fd==rhs._fd; }; bool operator!=(const WyFileHandle& rhs) const WY__TSPC() { return _fd!=rhs._fd; }; private: Wy__TypeFD _fd; class Assertion;};namespace Wy { const size_t _MaxPathSize=PATH_MAX; WyRet unlink(const WyStr&); WyRet unlink(const char*); WyRet access(const WyStr&,int); WyRet access(const char*,int); WyRet chdir(const WyStr& path); WyRet chdir(const char* path); WyRet getcwd(WyStr& path); WyRet chown(const WyStr& path,uid_t owner,gid_t group); WyRet chown(const char* path,uid_t owner,gid_t group); WyRet chmod(const WyStr& path,mode_t mode); WyRet chmod(const char* path,mode_t mode); WyRet link(const WyStr& oldpath,const WyStr& newpath); WyRet link(const char* oldpath,const char* newpath); inline WyRet link(const char* oldpath,const WyStr& newpath) { return link(oldpath,newpath.c_str()); }; inline WyRet link(const WyStr& oldpath,const char* newpath) { return link(oldpath.c_str(),newpath); };};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -