LCOV - code coverage report
Current view: top level - libs/url/src - static_url.cpp (source / functions) Hit Total Coverage
Test: coverage_filtered.info Lines: 17 24 70.8 %
Date: 2024-02-29 20:02:55 Functions: 3 5 60.0 %

          Line data    Source code
       1             : //
       2             : // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
       3             : //
       4             : // Distributed under the Boost Software License, Version 1.0. (See accompanying
       5             : // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
       6             : //
       7             : // Official repository: https://github.com/boostorg/url
       8             : //
       9             : 
      10             : #ifndef BOOST_URL_IMPL_STATIC_URL_IPP
      11             : #define BOOST_URL_IMPL_STATIC_URL_IPP
      12             : 
      13             : #include <boost/url/detail/config.hpp>
      14             : #include <boost/url/parse.hpp>
      15             : #include <boost/url/static_url.hpp>
      16             : #include <boost/url/url_view.hpp>
      17             : #include <boost/url/detail/except.hpp>
      18             : #include <boost/assert.hpp>
      19             : 
      20             : namespace boost {
      21             : namespace urls {
      22             : 
      23          29 : static_url_base::
      24             : static_url_base(
      25             :     char* buf,
      26          29 :     std::size_t cap) noexcept
      27             : {
      28          29 :     s_ = buf;
      29          29 :     cap_ = cap;
      30          29 :     s_[0] = '\0';
      31          29 :     impl_.cs_ = s_;
      32          29 : }
      33             : 
      34          15 : static_url_base::
      35             : static_url_base(
      36             :     char* buf,
      37             :     std::size_t cap,
      38          15 :     core::string_view s)
      39          17 :     : static_url_base(buf, cap)
      40             : {
      41          31 :     copy(parse_uri_reference(s
      42          16 :         ).value(BOOST_URL_POS));
      43          13 : }
      44             : 
      45             : void
      46           0 : static_url_base::
      47             : clear_impl() noexcept
      48             : {
      49           0 :     impl_ = {from::url};
      50           0 :     s_[0] = '\0';
      51           0 :     impl_.cs_ = s_;
      52           0 : }
      53             : 
      54             : void
      55          36 : static_url_base::
      56             : reserve_impl(
      57             :     std::size_t n,
      58             :     op_t&)
      59             : {
      60          36 :     if(n <= cap_)
      61          32 :         return;
      62           4 :     detail::throw_length_error();
      63             : }
      64             : 
      65             : //----------------------------------------------------------
      66             : 
      67             : void
      68           0 : static_url_base::
      69             : cleanup(op_t&)
      70             : {
      71           0 : }
      72             : 
      73             : } // urls
      74             : } // boost
      75             : 
      76             : #endif

Generated by: LCOV version 1.15