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-03-13 19:32:03 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             : 
      11             : #include <boost/url/detail/config.hpp>
      12             : #include <boost/url/parse.hpp>
      13             : #include <boost/url/static_url.hpp>
      14             : #include <boost/url/url_view.hpp>
      15             : #include <boost/url/detail/except.hpp>
      16             : #include <boost/assert.hpp>
      17             : 
      18             : namespace boost {
      19             : namespace urls {
      20             : 
      21          29 : static_url_base::
      22             : static_url_base(
      23             :     char* buf,
      24          29 :     std::size_t cap) noexcept
      25             : {
      26          29 :     s_ = buf;
      27          29 :     cap_ = cap;
      28          29 :     s_[0] = '\0';
      29          29 :     impl_.cs_ = s_;
      30          29 : }
      31             : 
      32          15 : static_url_base::
      33             : static_url_base(
      34             :     char* buf,
      35             :     std::size_t cap,
      36          15 :     core::string_view s)
      37          17 :     : static_url_base(buf, cap)
      38             : {
      39          31 :     copy(parse_uri_reference(s
      40          16 :         ).value(BOOST_URL_POS));
      41          13 : }
      42             : 
      43             : void
      44           0 : static_url_base::
      45             : clear_impl() noexcept
      46             : {
      47           0 :     impl_ = {from::url};
      48           0 :     s_[0] = '\0';
      49           0 :     impl_.cs_ = s_;
      50           0 : }
      51             : 
      52             : void
      53          36 : static_url_base::
      54             : reserve_impl(
      55             :     std::size_t n,
      56             :     op_t&)
      57             : {
      58          36 :     if(n <= cap_)
      59          32 :         return;
      60           4 :     detail::throw_length_error();
      61             : }
      62             : 
      63             : //----------------------------------------------------------
      64             : 
      65             : void
      66           0 : static_url_base::
      67             : cleanup(op_t&)
      68             : {
      69           0 : }
      70             : 
      71             : } // urls
      72             : } // boost
      73             : 

Generated by: LCOV version 1.15