Skip to content

Commit b1b4513

Browse files
authored
adds friend declarations to ada::url and ada::url_aggregator (#337)
1 parent 8fcd58c commit b1b4513

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

include/ada/helpers.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#define ADA_HELPERS_H
77

88
#include "ada/common_defs.h"
9-
#include "ada/url.h"
109
#include "ada/state.h"
1110
#include "ada/url_base.h"
1211

include/ada/parser.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@
66
#define ADA_PARSER_H
77

88
#include "ada/state.h"
9-
#include "ada/url.h"
109
#include "ada/encoding_type.h"
1110
#include "ada/expected.h"
12-
#include "ada/url_aggregator.h"
1311

1412
#include <optional>
1513
#include <string_view>
1614

15+
/**
16+
* @private
17+
*/
18+
namespace ada {
19+
struct url_aggregator;
20+
struct url;
21+
} // namespace ada
22+
1723
/**
1824
* @namespace ada::parser
1925
* @brief Includes the definitions for supported parsers

include/ada/url.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,10 @@ struct url : url_base {
388388
const noexcept;
389389

390390
private:
391+
friend ada::url_aggregator ada::parser::parse_url<ada::url_aggregator>(
392+
std::string_view, const ada::url_aggregator *);
393+
friend void ada::helpers::strip_trailing_spaces_from_opaque_path<ada::url>(
394+
ada::url &url) noexcept;
391395
/**
392396
* @private
393397
*

include/ada/url_aggregator.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ struct url_aggregator : url_base {
300300
bool check_trailing_content = false) noexcept override;
301301

302302
private:
303+
friend ada::url_aggregator ada::parser::parse_url<ada::url_aggregator>(
304+
std::string_view, const ada::url_aggregator *);
305+
friend void ada::helpers::strip_trailing_spaces_from_opaque_path<
306+
ada::url_aggregator>(ada::url_aggregator &url) noexcept;
303307
/** @private */
304308
std::string buffer{};
305309

0 commit comments

Comments
 (0)