Skip to content

Commit a6c11c6

Browse files
committed
Convert mqbcmd documentation to Doxygen format
This patch converts the BDE-style component documentation in the `mqbcmd` package into Doxygen `@file` documentation. This patch continues the work from commit 5e0f7e5. Signed-off-by: Patrick M. Niedzielski <[email protected]>
1 parent c9c6d6a commit a6c11c6

File tree

5 files changed

+81
-86
lines changed

5 files changed

+81
-86
lines changed

src/groups/mqb/mqbcmd/mqbcmd_commandlist.h

+6-10
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@
1717
#ifndef INCLUDED_MQBCMD_COMMANDLIST
1818
#define INCLUDED_MQBCMD_COMMANDLIST
1919

20-
//@PURPOSE: Provide a list of all commands the broker can respond to.
21-
//
22-
//@CLASSES:
23-
// CommandList: Utility namespace to get list of all broker commands
24-
//
25-
//@DESCRIPTION:
26-
// This component provides a namespace, 'mqbcmd::CommandList', containing
27-
// all of the broker commands and their description.
28-
29-
// MQB
20+
/// @file mqbcmd_commandlist.h
21+
///
22+
/// @brief Provide a list of all commands the broker can respond to.
23+
///
24+
/// This component provides a namespace, @bbref{mqbcmd::CommandList},
25+
/// containing all of the broker commands and their description.
3026

3127
namespace BloombergLP {
3228
namespace mqbcmd {

src/groups/mqb/mqbcmd/mqbcmd_humanprinter.h

+6-10
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,14 @@
1717
#ifndef INCLUDED_MQBCMD_HUMANPRINTER
1818
#define INCLUDED_MQBCMD_HUMANPRINTER
1919

20-
//@PURPOSE: Provide a namespace of utilities to human-friendly print results.
21-
//
22-
//@CLASSES:
23-
// HumanPrinter: Utilities to print results in a human-friendly way.
24-
//
25-
//@DESCRIPTION:
26-
// This component provides a namespace, 'mqbcmd::HumanPrinter', containing
27-
// utilities to print results in a human-friendly way.
28-
//
20+
/// @file mqbcmd_humanprinter
21+
///
22+
/// @brief Provide a namespace of utilities to human-friendly print results.
23+
///
24+
/// This component provides a namespace, @bbref{mqbcmd::HumanPrinter},
25+
/// containing utilities to print results in a human-friendly way.
2926

3027
// MQB
31-
3228
#include <mqbcmd_messages.h>
3329

3430
// BDE

src/groups/mqb/mqbcmd/mqbcmd_jsonprinter.h

+10-12
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@
1717
#ifndef INCLUDED_MQBCMD_JSONPRINTER
1818
#define INCLUDED_MQBCMD_JSONPRINTER
1919

20-
//@PURPOSE: Provide a namespace of utilities to print results in json.
21-
//
22-
//@CLASSES:
23-
// JsonPrinter: Utilities to print results in json.
24-
//
25-
//@DESCRIPTION:
26-
// This component provides a namespace, 'mqbcmd::JsonPrinter', containing
27-
// utilities to print results in json.
28-
//
20+
/// @file mqbcmd_jsonprinter.h
21+
///
22+
/// @brief Provide a namespace of utilities to print results in JSON.
23+
///
24+
///
25+
/// This component provides a namespace, @bbref{mqbcmd::JsonPrinter},
26+
/// containing utilities to print results in JSON.
2927

3028
// MQB
3129
#include <mqbcmd_messages.h>
@@ -40,14 +38,14 @@ namespace mqbcmd {
4038
// struct JsonPrinter
4139
// ==================
4240

43-
/// This `struct` provides a namespace of utilities to print results in json.
41+
/// This `struct` provides a namespace of utilities to print results in JSON.
4442
struct JsonPrinter {
4543
/// Print the specified `result` to the specified `os` at the
4644
/// (absolute value of) the optionally specified indentation `level` and
4745
/// return a reference to `stream`. If `level` is specified, optionally
4846
/// specify `spacesPerLevel`, the number of spaces per indentation level
4947
/// for this and all of its nested objects. If the optionally specified
50-
/// 'pretty' flag is true, print json in a human-friendly format, if it is
48+
/// 'pretty' flag is true, print JSON in a human-friendly format, if it is
5149
/// false, print the json in a compact format.
5250
static bsl::ostream& print(bsl::ostream& os,
5351
const Result& result,
@@ -60,7 +58,7 @@ struct JsonPrinter {
6058
/// return a reference to `stream`. If `level` is specified, optionally
6159
/// specify `spacesPerLevel`, the number of spaces per indentation level
6260
/// for this and all of its nested objects. If the optionally specified
63-
/// 'pretty' flag is true, print json in a human-friendly format, if it is
61+
/// 'pretty' flag is true, print JSON in a human-friendly format, if it is
6462
/// false, print the json in a compact format.
6563
static bsl::ostream& printResponses(bsl::ostream& os,
6664
const RouteResponseList& responseList,

src/groups/mqb/mqbcmd/mqbcmd_parseutil.h

+53-44
Original file line numberDiff line numberDiff line change
@@ -17,51 +17,60 @@
1717
#ifndef INCLUDED_MQBCMD_PARSEUTIL
1818
#define INCLUDED_MQBCMD_PARSEUTIL
1919

20-
//@PURPOSE: Provide a namespace of command parsing functions.
21-
//
22-
//@CLASSES:
23-
// ParseUtil: namespace of command parsing functions
24-
//
25-
//@DESCRIPTION:
26-
// This component provides a namespace, 'mqbcmd::ParseUtil', containing a
27-
// utility function for parsing "trap-like" broker commands. The resulting
28-
// object is an instance of a class generated from 'mqbcmd.xsd'.
29-
//
30-
/// Command Grammar
31-
///---------------
32-
// The structure of the parsed command is defined by 'mqbcmd.xsd'. The input
33-
// language, however, does not have a formal grammar. Its structure is defined
34-
// by this parser component. An informal description of the language is
35-
// returned by the broker in response to the "HELP" command.
36-
//
37-
/// Usage Example
38-
///-------------
39-
// This section illustrates intended use of this component.
40-
//
41-
/// Example 1: Parsing a Command in a "Trap" Handler
42-
/// - - - - - - - - - - - - - - - - - - - - - - - -
43-
// Suppose that a line of text is read by a command-line like interface and is
44-
// then to be interpreted as a command (e.g. in an "m-trap handler"). The text
45-
// can be parsed into a 'mqbcmd::Command' object using
46-
// 'mqbcmd::ParseUtil::parse':
47-
//..
48-
// void handleTrap(const bslstl::StringRef& line)
49-
// {
50-
// mqbcmd::Command command;
51-
// bsl::string error;
52-
//
53-
// if (mqbcmd::ParseUtil::parse(&command, &error, line)) {
54-
// BALL_LOG_ERROR << "Unable to parse command string: " << line
55-
// << " due to the error: " << error;
56-
// return; // RETURN
57-
// }
58-
//
59-
// // The command has been successfully parsed.
60-
// dispatch(command);
61-
// }
62-
//..
20+
// Clang-format warns about an overlong line in this comment, which gives a
21+
// Markdown anchor to a header. Unfortunately, by Markdown syntax rules, this
22+
// has to on the same line as the header, meaning we cannot introduce a
23+
// line-break here.
24+
25+
// clang-format off
26+
27+
/// @file mqbcmd_parseutil.h
28+
///
29+
/// @brief Provide a namespace of command parsing functions.
30+
///
31+
/// This component provides a namespace, @bbref{mqbcmd::ParseUtil}, containing
32+
/// a utility function for parsing "trap-like" broker commands. The resulting
33+
/// object is an instance of a class generated from `mqbcmd.xsd`.
34+
///
35+
/// Command Grammar {#mqbcmd_parseutil_grammar}
36+
/// ===============
37+
///
38+
/// The structure of the parsed command is defined by `mqbcmd.xsd`. The input
39+
/// language, however, does not have a formal grammar. Its structure is
40+
/// defined by this parser component. An informal description of the language
41+
/// is returned by the broker in response to the "HELP" command.
42+
///
43+
/// Usage Example {#mqbcmd_parseutil_usage}
44+
/// =============
45+
///
46+
/// This section illustrates intended use of this component.
47+
///
48+
/// Example 1: Parsing a Command in a "Trap" Handler {#mqbcmd_parseutil_usage_ex1}
49+
/// ------------------------------------------------
50+
///
51+
/// Suppose that a line of text is read by a command-line like interface and is
52+
/// then to be interpreted as a command (e.g. in an "m-trap handler"). The
53+
/// text can be parsed into a @bbref{mqbcmd::Command} object using
54+
/// @bbref{mqbcmd::ParseUtil::parse}:
55+
///
56+
/// ```
57+
/// void handleTrap(const bslstl::StringRef& line)
58+
/// {
59+
/// mqbcmd::Command command;
60+
/// bsl::string error;
61+
///
62+
/// if (mqbcmd::ParseUtil::parse(&command, &error, line)) {
63+
/// BALL_LOG_ERROR << "Unable to parse command string: " << line
64+
/// << " due to the error: " << error;
65+
/// return; // RETURN
66+
/// }
67+
///
68+
/// // The command has been successfully parsed.
69+
/// dispatch(command);
70+
/// }
71+
/// ```
6372

64-
// MQB
73+
// clang-format on
6574

6675
// BDE
6776
#include <bsl_string.h>

src/groups/mqb/mqbcmd/mqbcmd_util.h

+6-10
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,14 @@
1717
#ifndef INCLUDED_MQBCMD_UTIL
1818
#define INCLUDED_MQBCMD_UTIL
1919

20-
//@PURPOSE: Provide a namespace of command utilities.
21-
//
22-
//@CLASSES:
23-
// Util: namespace of command utilities
24-
//
25-
//@DESCRIPTION:
26-
// This component provides a namespace, 'mqbcmd::Util', containing utility
27-
// functions for commands.
28-
//
20+
/// @file mqbcmd_util.h
21+
///
22+
/// @brief Provide a namespace of command utilities.
23+
///
24+
/// This component provides a namespace, @bbref{mqbcmd::Util}, containing
25+
/// utility functions for commands.
2926

3027
// MQB
31-
3228
#include <mqbcmd_messages.h>
3329

3430
// BDE

0 commit comments

Comments
 (0)