Commit d6a2728
refactor: split webserver.hpp (845 → 498) into routes/ws/hooks
Step 5 of the FILE_LOC_MAX ratchet. Three concern-grouped sibling
sub-headers, each included from inside the webserver class body via
the same in-class-body #include pattern used for http_request_auth.hpp
and webserver_impl_dispatch.hpp:
webserver_routes.hpp register_path / register_prefix /
register_resource (templated + shared_ptr
overloads), the on_* shortcuts (on_get,
on_post, on_put, on_delete, on_patch,
on_options, on_head), the table-driven
route() overloads, and the matching
unregister_path / unregister_prefix /
unregister_resource.
webserver_websocket.hpp register_ws_resource (templated +
shared_ptr) and unregister_ws_resource.
webserver_hooks.hpp add_hook (11 overloads, one per
hook_phase) and the
HTTPSERVER_COMPILATION-gated
make_hook_handle_ factory.
Each sub-header gates itself on SRC_HTTPSERVER_WEBSERVER_HPP_INSIDE_CLASS_,
which webserver.hpp #define's before the include block and #undef's
after, so standalone inclusion raises a #error. The headers are
installed (nobase_include_HEADERS) so consumers see the declarations
transitively through <httpserver.hpp> -> webserver.hpp -> sibling.
They are NOT added to the umbrella's sub-header list because the
inner gate forbids standalone inclusion.
Public API order is preserved verbatim. No ABI change, no semantic
change. The fully-qualified @ref tags inside webserver_hooks.hpp
(@ref httpserver::hook_phase / @ref httpserver::hook_handle ...) are
unchanged in target; only the textual form needed qualification
because doxygen parses sub-headers without the enclosing namespace
context.
FILE_LOC_MAX stays at 2700 -- webserver.cpp (2673) still pins it.
Offender list down to two files.
Verification:
make check 51/51 PASS (includes hygiene,
install-layout, doxygen,
examples, readme, release-notes)
./scripts/check-file-size.sh PASS at FILE_LOC_MAX=2700
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7fc443a commit d6a2728
6 files changed
Lines changed: 492 additions & 363 deletions
File tree
- scripts
- src
- httpserver
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
0 commit comments