Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. | |
| 2 // | |
| 3 // Licensed under the Apache License, Version 2.0 (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 | |
| 6 // | |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 // | |
| 9 // Unless required by applicable law or agreed to in writing, software | |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 // See the License for the specific language governing permissions and | |
| 13 // limitations under the License. | |
| 14 | |
| 15 #ifndef CRASHPAD_UTIL_MAC_XATTR_H_ | |
| 16 #define CRASHPAD_UTIL_MAC_XATTR_H_ | |
| 17 | |
| 18 #include <time.h> | |
| 19 | |
| 20 #include "base/files/file_path.h" | |
| 21 #include "base/strings/string_piece.h" | |
| 22 | |
| 23 namespace crashpad { | |
| 24 | |
| 25 //! \brief Reads an extended attribute on a file. | |
| 26 //! | |
| 27 //! \param[in] file The path to the file. | |
| 28 //! \param[in] name The name of the extended attribute to read. | |
| 29 //! \param[out] value The value of the attribute. | |
| 30 //! | |
| 31 //! \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.
| |
| 32 //! error, with a message logged. | |
| 33 bool ReadXattr(const base::FilePath& file, | |
| 34 const base::StringPiece& name, | |
| 35 std::string* value); | |
|
Mark Mentovai
2014/12/19 23:16:32
#include <string>
Robert Sesek
2014/12/30 17:02:21
Done.
| |
| 36 | |
| 37 //! \brief Writes an extended attribute on a file. | |
| 38 //! | |
| 39 //! \param[in] file The path to the file. | |
| 40 //! \param[in] name The name of the extended attribute to write. | |
| 41 //! \param[in] value The value of the attribute. | |
| 42 //! | |
| 43 //! \return True if the write was successful. False on error, with a message | |
| 44 //! logged. | |
| 45 bool WriteXattr(const base::FilePath& file, | |
| 46 const base::StringPiece& name, | |
| 47 const std::string& value); | |
| 48 | |
| 49 //! \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.
| |
| 50 bool ReadXattrBool(const base::FilePath& file, | |
| 51 const base::StringPiece& name, | |
| 52 bool* value); | |
| 53 | |
| 54 //! \copydoc WriteXattr | |
| 55 bool WriteXattrBool(const base::FilePath& file, | |
| 56 const base::StringPiece& name, | |
| 57 bool value); | |
| 58 | |
| 59 //! \copydoc ReadXattr | |
| 60 bool ReadXattrInt(const base::FilePath& file, | |
| 61 const base::StringPiece& name, | |
| 62 int* value); | |
| 63 | |
| 64 //! \copydoc WriteXattr | |
| 65 bool WriteXattrInt(const base::FilePath& file, | |
| 66 const base::StringPiece& name, | |
| 67 int value); | |
| 68 | |
| 69 //! \copydoc ReadXattr | |
| 70 bool ReadXattrTimeT(const base::FilePath& file, | |
| 71 const base::StringPiece& name, | |
| 72 time_t* value); | |
| 73 | |
| 74 //! \copydoc WriteXattr | |
| 75 bool WriteXattrTimeT(const base::FilePath& file, | |
| 76 const base::StringPiece& name, | |
| 77 time_t value); | |
| 78 | |
| 79 } // namespace crashpad | |
| 80 | |
| 81 #endif // CRASHPAD_UTIL_MAC_XATTR_H_ | |
| OLD | NEW |