1#ifndef _pxattr_h_included_
2#define _pxattr_h_included_
83bool get(
const std::string& path,
const std::string& name, std::string* value,
88bool get(
int fd,
const std::string& name, std::string* value,
93bool set(
const std::string& path,
const std::string& name,
const std::string& value,
98bool set(
int fd,
const std::string& name,
const std::string& value,
103bool del(
const std::string& path,
const std::string& name,
flags flags = PXATTR_NONE,
112bool list(
const std::string& path, std::vector<std::string>* names,
117bool list(
int fd, std::vector<std::string>* names,
Provide a uniform C++ API for extended file attributes on Linux/FreeBSD and MacOSX.
Definition pxattr.h:63
bool list(const std::string &path, std::vector< std::string > *names, flags flags=PXATTR_NONE, nspace dom=PXATTR_USER)
List attribute names from path.
flags
Flags can modify the behaviour of some methods.
Definition pxattr.h:71
@ PXATTR_REPLACE
Fail if new.
Definition pxattr.h:77
@ PXATTR_NOFOLLOW
Act on link instead of following it.
Definition pxattr.h:73
@ PXATTR_CREATE
Fail if existing.
Definition pxattr.h:75
bool get(const std::string &path, const std::string &name, std::string *value, flags flags=PXATTR_NONE, nspace dom=PXATTR_USER)
Retrieve the named attribute from path.
bool del(const std::string &path, const std::string &name, flags flags=PXATTR_NONE, nspace dom=PXATTR_USER)
Delete the named attribute from path.
bool set(const std::string &path, const std::string &name, const std::string &value, flags flags=PXATTR_NONE, nspace dom=PXATTR_USER)
Set the named attribute on path.
bool pxname(nspace dom, const std::string &sname, std::string *pname)
Compute external name from actual/system name (ie: user.myattr->myattr)
nspace
nspace might be used in the future if we support multiple namespaces.
Definition pxattr.h:65
@ PXATTR_USER
User name space.
Definition pxattr.h:67
bool sysname(nspace dom, const std::string &pname, std::string *sname)
Compute actual/system attribute name from external name (ie: myattr->user.myattr)