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_POSIX_SYMBOLIC_CONSTANTS_POSIX_H_ |
| 16 #define CRASHPAD_UTIL_POSIX_SYMBOLIC_CONSTANTS_POSIX_H_ |
| 17 |
| 18 #include <string> |
| 19 |
| 20 #include "base/strings/string_piece.h" |
| 21 #include "util/misc/symbolic_constants_common.h" |
| 22 |
| 23 namespace crashpad { |
| 24 |
| 25 //! \brief Converts a POSIX signal value to a textual representation. |
| 26 //! |
| 27 //! \param[in] signal The signal value to convert. |
| 28 //! \param[in] options Options affecting the conversion. ::kUseOr is ignored. |
| 29 //! For ::kUnknownIsNumeric, the format is `"%d"`. |
| 30 //! |
| 31 //! \return The converted string. |
| 32 std::string SignalToString(int signal, SymbolicConstantToStringOptions options); |
| 33 |
| 34 //! \brief Converts a string to its corresponding POSIX signal value. |
| 35 //! |
| 36 //! \param[in] string The string to convert. |
| 37 //! \param[in] options Options affecting the conversion. ::kAllowOr is ignored. |
| 38 //! \param[out] signal The converted POSIX signal value. |
| 39 //! |
| 40 //! \return `true` on success, `false` if \a string could not be converted as |
| 41 //! requested. |
| 42 bool StringToSignal(const base::StringPiece& string, |
| 43 StringToSymbolicConstantOptions options, |
| 44 int* signal); |
| 45 |
| 46 } // namespace crashpad |
| 47 |
| 48 #endif // CRASHPAD_UTIL_POSIX_SYMBOLIC_CONSTANTS_POSIX_H_ |
OLD | NEW |