forked from cpp-netlib/cpp-netlib
-
Notifications
You must be signed in to change notification settings - Fork 0
C++ Network Library Style Guidelines
deanberris edited this page Sep 9, 2012
·
3 revisions
I’m starting this in response to a question raised on the mailing list.
Now, style guidelines sound like a great idea, but in practice this is going to be impossible to enforce. For one thing, any guidelines are going to be pretty much arbitrary and not easy to defend if anyone breaks them, and the project admins will probably feel it’s not a valuable use of their time. But, consistency of style is going to be vital as this project grows.
So, beyond boost’s own requirements, it’s perhaps a good idea to define what’s acceptable and not acceptable within our own project.
I can start with some observations I’ve made about the organisation of the directory and namespace structures:
- protocol specific stuff belongs in the namespace (e.g. HTTP)
network::http
and the directoryinclude/network/protocol/http/
. -
URI specific stuff belongs in (e.g. HTTP)
network::http
and directoryinclude/network/uri/http
. - Implementation specific headers belong in
network::http::detail
include/network/uri/http/detail
. - Each URI protocol requires the files
uri.hpp
anduri_concepts.hpp
, - Anything that extends the Message concept needs to define a file
message_concepts.hpp
. - Implementations are put in
.ipp
files that live alongside the.hpp
files. The.ipp
file is included by a.cpp
file inlibs/network/src/
which is then compiled.