Skip to content

Commit

Permalink
A #include cleanup in the *.h files
Browse files Browse the repository at this point in the history
* Add directly used header files

* Remove unused header files

* Update copyright year
  • Loading branch information
rmisev committed Jul 3, 2024
1 parent 4cefcbe commit c40a6f4
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 15 deletions.
4 changes: 2 additions & 2 deletions include/upa/buffer.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016-2023 Rimas Misevičius
// Copyright 2016-2024 Rimas Misevičius
// Distributed under the BSD-style license that can be
// found in the LICENSE file.
//
Expand All @@ -11,10 +11,10 @@
#define UPA_BUFFER_H

#include <array>
#include <cstddef>
#include <memory>
#include <stdexcept>
#include <string>
#include <type_traits>

namespace upa {

Expand Down
13 changes: 7 additions & 6 deletions include/upa/str_arg.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016-2023 Rimas Misevičius
// Copyright 2016-2024 Rimas Misevičius
// Distributed under the BSD-style license that can be
// found in the LICENSE file.
//
Expand All @@ -21,9 +21,10 @@ inline void procfn(Args&&... args) {
#include "config.h"
#include "url_utf.h"
#include <cassert>
#include <iterator>
#include <cstddef>
#include <string>
#include <type_traits>
#include <utility>

#ifdef UPA_CPP_17
# include <string_view>
Expand Down Expand Up @@ -137,15 +138,15 @@ namespace detail {

// test class T has data() member
template<class T>
static auto test_data(int) -> decltype(std::declval<T>().data());
auto test_data(int) -> decltype(std::declval<T>().data());
template<class>
static auto test_data(long) -> void;
auto test_data(long) -> void;

// test class T has length() member
template<class T>
static auto test_length(int) -> decltype(std::declval<T>().length());
auto test_length(int) -> decltype(std::declval<T>().length());
template<class>
static auto test_length(long) -> void;
auto test_length(long) -> void;

// T::data() return type (void - if no such member)
template<class T>
Expand Down
5 changes: 4 additions & 1 deletion include/upa/str_view.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016-2023 Rimas Misevičius
// Copyright 2016-2024 Rimas Misevičius
// Distributed under the BSD-style license that can be
// found in the LICENSE file.
//
Expand All @@ -8,6 +8,9 @@

#include "config.h"
#include <algorithm>
#include <cstddef>
#include <iterator>
#include <ostream>
#include <string>
#include <type_traits>

Expand Down
2 changes: 2 additions & 0 deletions include/upa/url.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
#include <algorithm>
#include <array>
#include <cassert>
#include <cstddef>
#include <cstdint> // uint8_t
#include <iterator> // std::next
#include <string>
#include <type_traits>
#include <utility>
#include <vector>

Expand Down
4 changes: 3 additions & 1 deletion include/upa/url_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
#define UPA_URL_HOST_H

#include "buffer.h"
#include "config.h"
#include "str_arg.h"
#include "url_idna.h"
#include "url_ip.h"
#include "url_percent_encode.h"
#include "url_result.h"
#include "url_utf.h"
#include "util.h"
#include <algorithm> // any_of
#include <cassert>
#include <cstdint> // uint16_t, uint32_t
#include <stdexcept>
#include <string>
#include <type_traits>

namespace upa {

Expand Down
3 changes: 2 additions & 1 deletion include/upa/url_idna.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016-2023 Rimas Misevičius
// Copyright 2016-2024 Rimas Misevičius
// Distributed under the BSD-style license that can be
// found in the LICENSE file.
//
Expand All @@ -8,6 +8,7 @@

#include "buffer.h"
#include "url_result.h"
#include <cstddef>

namespace upa {

Expand Down
7 changes: 5 additions & 2 deletions include/upa/url_percent_encode.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016-2023 Rimas Misevičius
// Copyright 2016-2024 Rimas Misevičius
// Distributed under the BSD-style license that can be
// found in the LICENSE file.
//
Expand All @@ -14,9 +14,12 @@
#include "str_arg.h"
#include "url_utf.h"
#include "util.h"
#include <array>
#include <cstddef>
#include <cstdint> // uint8_t
#include <initializer_list>
#include <string>
#include <type_traits>
#include <utility>


namespace upa {
Expand Down
3 changes: 2 additions & 1 deletion include/upa/url_utf.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016-2023 Rimas Misevičius
// Copyright 2016-2024 Rimas Misevičius
// Distributed under the BSD-style license that can be
// found in the LICENSE file.
//
Expand All @@ -8,6 +8,7 @@

#include "buffer.h"
#include "url_result.h"
#include <cstddef>
#include <cstdint> // uint8_t, uint32_t
#include <string>

Expand Down
2 changes: 1 addition & 1 deletion src/url_ip.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016-2023 Rimas Misevičius
// Copyright 2016-2024 Rimas Misevičius
// Distributed under the BSD-style license that can be
// found in the LICENSE file.
//
Expand Down

0 comments on commit c40a6f4

Please sign in to comment.