From bedbfd18d79e00d2b91ae2ca3fe26bae1ebc26ef Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Fri, 29 Jun 2007 08:18:16 +0200 Subject: [PATCH] add dox doc for header and trailer PrintTo and DoGetName --- src/common/header.h | 13 +++++++++++++ src/common/trailer.h | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/common/header.h b/src/common/header.h index 480dbe65e..609729b26 100644 --- a/src/common/header.h +++ b/src/common/header.h @@ -43,11 +43,24 @@ public: private: /** * \returns a user-readable name to identify this type of header. + * + * The string returned is expected to be a single word with + * all capital letters */ virtual std::string DoGetName (void) const = 0; /** * \param os the std output stream in which this * protocol header must print itself. + * + * Although the header is free to format its output as it + * wishes, it is recommended to follow a few rules to integrate + * with the packet pretty printer: + * - start with flags, small field values located between a + * pair of parens. Values should be separated by whitespace. + * - follow the parens with the important fields, separated by + * whitespace. + * i.e.: + * (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5 */ virtual void PrintTo (std::ostream &os) const = 0; diff --git a/src/common/trailer.h b/src/common/trailer.h index c63fd5d85..92aef295f 100644 --- a/src/common/trailer.h +++ b/src/common/trailer.h @@ -69,11 +69,24 @@ public: private: /** * \returns a user-readable name to identify this type of header. + * + * The string returned is expected to be a single word with + * all capital letters */ virtual std::string DoGetName (void) const = 0; /** * \param os the std output stream in which this * protocol trailer must print itself. + * + * Although the header is free to format its output as it + * wishes, it is recommended to follow a few rules to integrate + * with the packet pretty printer: + * - start with flags, small field values located between a + * pair of parens. Values should be separated by whitespace. + * - follow the parens with the important fields, separated by + * whitespace. + * i.e.: + * (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5 */ virtual void PrintTo (std::ostream &os) const = 0;