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_NET_HTTP_BODY_TEST_UTIL_H_ |
| 16 #define CRASHPAD_UTIL_NET_HTTP_BODY_TEST_UTIL_H_ |
| 17 |
| 18 #include <sys/types.h> |
| 19 |
| 20 #include <string> |
| 21 |
| 22 namespace crashpad { |
| 23 |
| 24 class HTTPBodyStream; |
| 25 |
| 26 namespace test { |
| 27 |
| 28 //! \brief Reads a HTTPBodyStream to a string. If an error occurs, adds a |
| 29 //! test failure and returns an empty string. |
| 30 //! |
| 31 //! \param[in] stream The stream from which to read. |
| 32 //! |
| 33 //! \return The contents of the stream, or an empty string on failure. |
| 34 std::string ReadStreamToString(HTTPBodyStream* stream); |
| 35 |
| 36 //! \brief Reads a HTTPBodyStream to a string. If an error occurs, adds a |
| 37 //! test failure and returns an empty string. |
| 38 //! |
| 39 //! \param[in] stream The stream from which to read. |
| 40 //! \param[in] buffer_size The size of the buffer to use when reading from the |
| 41 //! stream. |
| 42 //! |
| 43 //! \return The contents of the stream, or an empty string on failure. |
| 44 std::string ReadStreamToString(HTTPBodyStream* stream, size_t buffer_size); |
| 45 |
| 46 } // namespace test |
| 47 } // namespace crashpad |
| 48 |
| 49 #endif // CRASHPAD_UTIL_NET_HTTP_BODY_TEST_UTIL_H_ |
OLD | NEW |