OLD | NEW |
---|---|
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
13 // limitations under the License. | 13 // limitations under the License. |
14 | 14 |
15 #ifndef CRASHPAD_UTIL_MAC_XATTR_H_ | 15 #ifndef CRASHPAD_UTIL_MAC_XATTR_H_ |
16 #define CRASHPAD_UTIL_MAC_XATTR_H_ | 16 #define CRASHPAD_UTIL_MAC_XATTR_H_ |
17 | 17 |
18 #include <time.h> | 18 #include <time.h> |
19 | 19 |
20 #include <string> | 20 #include <string> |
21 | 21 |
22 #include "base/files/file_path.h" | 22 #include "base/files/file_path.h" |
23 #include "base/strings/string_piece.h" | 23 #include "base/strings/string_piece.h" |
24 | 24 |
25 namespace crashpad { | 25 namespace crashpad { |
26 | 26 |
27 //! \brief Tests if an extended attribute is present on a file. | |
Mark Mentovai
2015/01/08 22:38:10
Meh. I’d rather the ReadXattr-family functions be
| |
28 //! | |
29 //! \param[in] file The path to the file. | |
30 //! \param[in] name The name of the extended attribute to test. | |
31 //! | |
32 //! \return `true` if the attribute exists, `false` if it does not. | |
33 bool HasXattr(const base::FilePath& file, const base::StringPiece& name); | |
34 | |
27 //! \brief Reads an extended attribute on a file. | 35 //! \brief Reads an extended attribute on a file. |
28 //! | 36 //! |
29 //! \param[in] file The path to the file. | 37 //! \param[in] file The path to the file. |
30 //! \param[in] name The name of the extended attribute to read. | 38 //! \param[in] name The name of the extended attribute to read. |
31 //! \param[out] value The value of the attribute. | 39 //! \param[out] value The value of the attribute. |
32 //! | 40 //! |
33 //! \return `true` if the read was successful, with \a value filled in. `false` | 41 //! \return `true` if the read was successful, with \a value filled in. `false` |
34 //! on error, with a message logged. | 42 //! on error, with a message logged. |
35 bool ReadXattr(const base::FilePath& file, | 43 bool ReadXattr(const base::FilePath& file, |
36 const base::StringPiece& name, | 44 const base::StringPiece& name, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 time_t* value); | 85 time_t* value); |
78 | 86 |
79 //! \copydoc WriteXattr | 87 //! \copydoc WriteXattr |
80 bool WriteXattrTimeT(const base::FilePath& file, | 88 bool WriteXattrTimeT(const base::FilePath& file, |
81 const base::StringPiece& name, | 89 const base::StringPiece& name, |
82 time_t value); | 90 time_t value); |
83 | 91 |
84 } // namespace crashpad | 92 } // namespace crashpad |
85 | 93 |
86 #endif // CRASHPAD_UTIL_MAC_XATTR_H_ | 94 #endif // CRASHPAD_UTIL_MAC_XATTR_H_ |
OLD | NEW |