From abd5e7dec039386628223f886b33047734172c8d Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 26 Mar 2023 21:12:25 -0400 Subject: Extend internal API docs, part 2 Picking up from #8111. Co-authored-by: Eelco Dolstra --- src/libutil/config.hh | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'src/libutil/config.hh') diff --git a/src/libutil/config.hh b/src/libutil/config.hh index 748d6043b..2cefab006 100644 --- a/src/libutil/config.hh +++ b/src/libutil/config.hh @@ -124,21 +124,21 @@ public: void reapplyUnknownSettings(); }; -/* A class to simplify providing configuration settings. The typical - use is to inherit Config and add Setting members: - - class MyClass : private Config - { - Setting foo{this, 123, "foo", "the number of foos to use"}; - Setting bar{this, "blabla", "bar", "the name of the bar"}; - - MyClass() : Config(readConfigFile("/etc/my-app.conf")) - { - std::cout << foo << "\n"; // will print 123 unless overridden - } - }; -*/ - +/** + * A class to simplify providing configuration settings. The typical + * use is to inherit Config and add Setting members: + * + * class MyClass : private Config + * { + * Setting foo{this, 123, "foo", "the number of foos to use"}; + * Setting bar{this, "blabla", "bar", "the name of the bar"}; + * + * MyClass() : Config(readConfigFile("/etc/my-app.conf")) + * { + * std::cout << foo << "\n"; // will print 123 unless overridden + * } + * }; + */ class Config : public AbstractConfig { friend class AbstractSetting; @@ -228,7 +228,9 @@ protected: bool isOverridden() const { return overridden; } }; -/* A setting of type T. */ +/** + * A setting of type T. + */ template class BaseSetting : public AbstractSetting { @@ -311,8 +313,10 @@ public: void operator =(const T & v) { this->assign(v); } }; -/* A special setting for Paths. These are automatically canonicalised - (e.g. "/foo//bar/" becomes "/foo/bar"). */ +/** + * A special setting for Paths. These are automatically canonicalised + * (e.g. "/foo//bar/" becomes "/foo/bar"). + */ class PathSetting : public BaseSetting { bool allowEmpty; -- cgit v1.2.3 From f4ab297b3185ca4214cfa83bbd4b8f0039b6fadf Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 31 Mar 2023 23:18:41 -0400 Subject: Ensure all headers have `#pragma once` and are in API docs `///@file` makes them show up in the internal API dos. A tiny few were missing `#pragma once`. --- src/libutil/config.hh | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libutil/config.hh') diff --git a/src/libutil/config.hh b/src/libutil/config.hh index 2cefab006..3c1d70294 100644 --- a/src/libutil/config.hh +++ b/src/libutil/config.hh @@ -1,4 +1,5 @@ #pragma once +///@file #include #include -- cgit v1.2.3