Skip to content

Commit a1c32a5

Browse files
committed
docs: update namespace definitions
1 parent 487c098 commit a1c32a5

File tree

15 files changed

+59
-16
lines changed

15 files changed

+59
-16
lines changed

doxygen

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ RECURSIVE = YES
10171017
# Note that relative paths are relative to the directory from which doxygen is
10181018
# run.
10191019

1020-
EXCLUDE = benchmarks, tests, Testing, tools, build, docs
1020+
EXCLUDE = benchmarks, tests, Testing, tools, build, docs, include/ada/expected.h, singleheader, include/ada/log.h
10211021

10221022
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
10231023
# directories that are symbolic links (a Unix file system feature) are excluded

include/ada.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @file ada.h
3+
* @brief Includes all definitions for Ada.
4+
*/
15
#ifndef ADA_H
26
#define ADA_H
37

include/ada/character_sets.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include "ada/common_defs.h"
1111
#include <stdint.h>
1212

13+
/**
14+
* @namespace ada::character_sets
15+
* @brief Includes the definitions for unicode character sets.
16+
*/
1317
namespace ada::character_sets {
1418
ada_really_inline bool bit_at(const uint8_t a[], const uint8_t i);
1519
} // namespace ada::character_sets

include/ada/checkers-inl.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file checkers.h
2+
* @file checkers-inl.h
33
* @brief Definitions for URL specific checkers used within Ada.
44
*/
55
#ifndef ADA_CHECKERS_INL_H
@@ -23,23 +23,31 @@ namespace ada::checkers {
2323
if(is_little_endian) { two_first_bytes |= 0x2000; } else { two_first_bytes |= 0x020; }
2424
return two_first_bytes == word0x;
2525
}
26+
2627
inline bool has_hex_prefix(std::string_view input) {
2728
return input.size() >=2 && has_hex_prefix_unsafe(input);
2829
}
30+
2931
constexpr bool is_digit(char x) noexcept { return (x >= '0') & (x <= '9'); }
32+
3033
constexpr char to_lower(char x) noexcept { return (x | 0x20); }
34+
3135
constexpr bool is_alpha(char x) noexcept { return (to_lower(x) >= 'a') && (to_lower(x) <= 'z'); }
36+
3237
inline constexpr bool is_windows_drive_letter(std::string_view input) noexcept {
3338
return input.size() >= 2 && (is_alpha(input[0]) && ((input[1] == ':') || (input[1] == '|')))
3439
&& ((input.size() == 2) || (input[2] == '/' || input[2] == '\\' || input[2] == '?' || input[2] == '#'));
3540
}
41+
3642
inline constexpr bool is_normalized_windows_drive_letter(std::string_view input) noexcept {
3743
return input.size() >= 2 && (is_alpha(input[0]) && (input[1] == ':'));
3844
}
45+
3946
ada_really_inline constexpr bool begins_with(std::string_view view, std::string_view prefix) {
4047
// in C++20, you have view.begins_with(prefix)
4148
return view.size() >= prefix.size() && (view.substr(0, prefix.size()) == prefix);
4249
}
50+
4351
} // namespace ada::checkers
4452

4553
#endif //ADA_CHECKERS_H

include/ada/checkers.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include <string_view>
1111
#include <cstring>
1212

13+
/**
14+
* @namespace ada::checkers
15+
* @brief Includes the definitions for validation functions
16+
*/
1317
namespace ada::checkers {
1418

1519
/**
@@ -76,7 +80,6 @@ namespace ada::checkers {
7680
*/
7781
ada_really_inline constexpr uint8_t path_signature(std::string_view input) noexcept;
7882

79-
8083
/**
8184
* Returns true if the length of the domain name and its labels are according to the specifications.
8285
* The length of the domain must be 255 octets (253 characters not including the last 2 which are the empty

include/ada/expected.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* @file expected.h
3+
* @brief Definitions for std::expected
4+
* @private Excluded from docs through the doxygen file.
5+
*/
16
///
27
// expected - An implementation of std::expected with extensions
38
// Written in 2017 by Sy Brand (tartanllama@gmail.com, @TartanLlama)

include/ada/helpers.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#include <string_view>
1313
#include <optional>
1414

15+
/**
16+
* @namespace ada::helpers
17+
* @brief Includes the definitions for helper functions
18+
*/
1519
namespace ada::helpers {
1620

1721
/**

include/ada/implementation.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/**
22
* @file implementation.h
3-
*
43
* @brief Definitions for user facing functions for parsing URL and it's components.
54
*/
65
#ifndef ADA_IMPLEMENTATION_H
@@ -29,19 +28,12 @@ namespace ada {
2928
* @param base_url the optional string input to use as a base url.
3029
* @param encoding encoding (default to UTF-8)
3130
* @return a parsed URL.
32-
*
33-
* @example
34-
*
35-
* ```cpp
36-
* auto url = ada::url parse("https://www.google.com");
37-
* ```
3831
*/
3932
ada_warn_unused ada::result parse(std::string_view input,
4033
const ada::url* base_url = nullptr,
4134
ada::encoding_type encoding = ada::encoding_type::UTF8);
4235
/**
4336
* Computes a href string from a file path.
44-
* @param input a path
4537
* @return a href string (starts with file:://)
4638
*/
4739
std::string href_from_file(std::string_view path);

include/ada/log.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
21
/**
32
* @file log.h
4-
* @private
5-
* @brief logging code.
3+
* @brief Includes the definitions for logging.
4+
* @private Excluded from docs through the doxygen file.
65
*/
76
#ifndef ADA_LOG_H
87
#define ADA_LOG_H

include/ada/parser.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#include <optional>
1313
#include <string_view>
1414

15+
/**
16+
* @namespace ada::parser
17+
* @brief Includes the definitions for supported parsers
18+
*/
1519
namespace ada::parser {
1620

1721
/**

0 commit comments

Comments
 (0)