Index: util/mac/xattr.h |
diff --git a/util/mac/xattr.h b/util/mac/xattr.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3e11aa0b9dfc54f438cc5872c447e539c1629e04 |
--- /dev/null |
+++ b/util/mac/xattr.h |
@@ -0,0 +1,81 @@ |
+// Copyright 2014 The Crashpad Authors. All rights reserved. |
+// |
+// Licensed under the Apache License, Version 2.0 (the "License"); |
+// you may not use this file except in compliance with the License. |
+// You may obtain a copy of the License at |
+// |
+// http://www.apache.org/licenses/LICENSE-2.0 |
+// |
+// Unless required by applicable law or agreed to in writing, software |
+// distributed under the License is distributed on an "AS IS" BASIS, |
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
+// See the License for the specific language governing permissions and |
+// limitations under the License. |
+ |
+#ifndef CRASHPAD_UTIL_MAC_XATTR_H_ |
+#define CRASHPAD_UTIL_MAC_XATTR_H_ |
+ |
+#include <time.h> |
+ |
+#include "base/files/file_path.h" |
+#include "base/strings/string_piece.h" |
+ |
+namespace crashpad { |
+ |
+//! \brief Reads an extended attribute on a file. |
+//! |
+//! \param[in] file The path to the file. |
+//! \param[in] name The name of the extended attribute to read. |
+//! \param[out] value The value of the attribute. |
+//! |
+//! \return True if the read was successful, with \a value filled in. False on |
Mark Mentovai
2014/12/19 23:16:32
`true` and `false`. Line 43 too.
Robert Sesek
2014/12/30 17:02:21
Done.
|
+//! error, with a message logged. |
+bool ReadXattr(const base::FilePath& file, |
+ const base::StringPiece& name, |
+ std::string* value); |
Mark Mentovai
2014/12/19 23:16:32
#include <string>
Robert Sesek
2014/12/30 17:02:21
Done.
|
+ |
+//! \brief Writes an extended attribute on a file. |
+//! |
+//! \param[in] file The path to the file. |
+//! \param[in] name The name of the extended attribute to write. |
+//! \param[in] value The value of the attribute. |
+//! |
+//! \return True if the write was successful. False on error, with a message |
+//! logged. |
+bool WriteXattr(const base::FilePath& file, |
+ const base::StringPiece& name, |
+ const std::string& value); |
+ |
+//! \copydoc ReadXattr |
Mark Mentovai
2014/12/19 23:16:32
Append something to this saying that you only cons
Robert Sesek
2014/12/30 17:02:21
Done.
|
+bool ReadXattrBool(const base::FilePath& file, |
+ const base::StringPiece& name, |
+ bool* value); |
+ |
+//! \copydoc WriteXattr |
+bool WriteXattrBool(const base::FilePath& file, |
+ const base::StringPiece& name, |
+ bool value); |
+ |
+//! \copydoc ReadXattr |
+bool ReadXattrInt(const base::FilePath& file, |
+ const base::StringPiece& name, |
+ int* value); |
+ |
+//! \copydoc WriteXattr |
+bool WriteXattrInt(const base::FilePath& file, |
+ const base::StringPiece& name, |
+ int value); |
+ |
+//! \copydoc ReadXattr |
+bool ReadXattrTimeT(const base::FilePath& file, |
+ const base::StringPiece& name, |
+ time_t* value); |
+ |
+//! \copydoc WriteXattr |
+bool WriteXattrTimeT(const base::FilePath& file, |
+ const base::StringPiece& name, |
+ time_t value); |
+ |
+} // namespace crashpad |
+ |
+#endif // CRASHPAD_UTIL_MAC_XATTR_H_ |