Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:05

0001 
0002 //              Copyright Catch2 Authors
0003 // Distributed under the Boost Software License, Version 1.0.
0004 //   (See accompanying file LICENSE.txt or copy at
0005 //        https://www.boost.org/LICENSE_1_0.txt)
0006 
0007 // SPDX-License-Identifier: BSL-1.0
0008 #ifndef CATCH_PARSE_NUMBERS_HPP_INCLUDED
0009 #define CATCH_PARSE_NUMBERS_HPP_INCLUDED
0010 
0011 #include <catch2/internal/catch_optional.hpp>
0012 
0013 #include <string>
0014 
0015 namespace Catch {
0016 
0017     /**
0018      * Parses unsigned int from the input, using provided base
0019      *
0020      * Effectively a wrapper around std::stoul but with better error checking
0021      * e.g. "-1" is rejected, instead of being parsed as UINT_MAX.
0022      */
0023     Optional<unsigned int> parseUInt(std::string const& input, int base = 10);
0024 }
0025 
0026 #endif // CATCH_PARSE_NUMBERS_HPP_INCLUDED