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.

78 lines
2.3 KiB

  1. /*
  2. The MIT License (MIT)
  3. Copyright (c) 2014 Antonio SJ Musumeci <trapexit@spawn.link>
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18. THE SOFTWARE.
  19. */
  20. #ifndef __FS_XATTR_HPP__
  21. #define __FS_XATTR_HPP__
  22. #include <string>
  23. #include <vector>
  24. #include <map>
  25. namespace fs
  26. {
  27. namespace xattr
  28. {
  29. using std::size_t;
  30. using std::string;
  31. using std::vector;
  32. using std::map;
  33. int list(const string &path,
  34. vector<char> &attrs);
  35. int list(const string &path,
  36. string &attrs);
  37. int list(const string &path,
  38. vector<string> &attrs);
  39. int get(const string &path,
  40. const string &attr,
  41. vector<char> &value);
  42. int get(const string &path,
  43. const string &attr,
  44. string &value);
  45. int get(const string &path,
  46. map<string,string> &attrs);
  47. int set(const string &path,
  48. const string &key,
  49. const string &value,
  50. const int flags);
  51. int set(const int fd,
  52. const string &key,
  53. const string &value,
  54. const int flags);
  55. int set(const string &path,
  56. const map<string,string> &attrs);
  57. int copy(const int fdin,
  58. const int fdout);
  59. int copy(const string &from,
  60. const string &to);
  61. }
  62. }
  63. #endif // __FS_HPP__