uri: change clear
into clear_fragment
This commit is contained in:
parent
0912f68844
commit
5e05584708
14
uri.cpp
14
uri.cpp
@ -128,18 +128,16 @@ uri::set (component c, std::string_view val)
|
|||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void uri::clear (component const c)
|
void uri::clear_fragment ()
|
||||||
{
|
{
|
||||||
auto const offset = m_views[c].size ();
|
if (!m_views[FRAGMENT])
|
||||||
for (int i = c + 1; i < component::NUM_COMPONENTS; ++i)
|
return;
|
||||||
m_views[i] -= offset;
|
|
||||||
|
|
||||||
m_value.erase (
|
m_value.erase (
|
||||||
m_views[c].begin () - m_value.data (),
|
m_views[FRAGMENT].begin () - m_value.data (),
|
||||||
m_views[c].size ()
|
m_views[FRAGMENT].size ()
|
||||||
);
|
);
|
||||||
|
m_views[FRAGMENT] = nullptr;
|
||||||
m_views[c] = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
3
uri.hpp
3
uri.hpp
@ -100,7 +100,8 @@ namespace cruft {
|
|||||||
std::string_view query (void) const& { return get (QUERY); }
|
std::string_view query (void) const& { return get (QUERY); }
|
||||||
std::string_view fragment (void) const& { return get (FRAGMENT); }
|
std::string_view fragment (void) const& { return get (FRAGMENT); }
|
||||||
|
|
||||||
void clear (component);
|
// void clear (component);
|
||||||
|
void clear_fragment (void);
|
||||||
|
|
||||||
auto components (void) const& noexcept { return m_views; }
|
auto components (void) const& noexcept { return m_views; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user