From db08a5946f2f0d50ca4141367ff23ad37ff6c7e9 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 30 Jul 2013 18:08:49 -0700 Subject: [PATCH] Tidy up BuildInfo documentation --- .../ripple_app/basics/ripple_BuildInfo.cpp | 45 ++++++++++++------- modules/ripple_app/basics/ripple_BuildInfo.h | 6 +-- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/modules/ripple_app/basics/ripple_BuildInfo.cpp b/modules/ripple_app/basics/ripple_BuildInfo.cpp index c52bcad4d3..b0054b89b5 100644 --- a/modules/ripple_app/basics/ripple_BuildInfo.cpp +++ b/modules/ripple_app/basics/ripple_BuildInfo.cpp @@ -17,12 +17,10 @@ String const& BuildInfo::getVersionString () //-------------------------------------------------------------------------- ; - struct StaticInitializer + struct SanityChecker { - StaticInitializer () + SanityChecker () { - // Sanity checking on the raw text - Version v; if (! v.parse (rawText) || v.print () != rawText) @@ -34,39 +32,54 @@ String const& BuildInfo::getVersionString () String versionString; }; - static StaticInitializer value; + static SanityChecker value; return value.versionString; } -// The protocol version we speak and prefer. -// BuildInfo::Protocol const& BuildInfo::getCurrentProtocol () { - static Protocol currentProtocol (1, 2); + static Protocol currentProtocol ( + + //-------------------------------------------------------------------------- + // + // The protocol version we speak and prefer (edit this if necessary) + // + 1, // major + 2 // minor + // + //-------------------------------------------------------------------------- + ); return currentProtocol; } -// The oldest protocol version we will accept. -// BuildInfo::Protocol const& BuildInfo::getMinimumProtocol () { - static Protocol minimumProtocol (1, 2); + static Protocol minimumProtocol ( + + //-------------------------------------------------------------------------- + // + // The oldest protocol version we will accept. (edit this if necessary) + // + 1, // major + 2 // minor + // + //-------------------------------------------------------------------------- + ); return minimumProtocol; } - - // Don't touch anything below this line +// //------------------------------------------------------------------------------ char const* BuildInfo::getFullVersionString () { - struct StaticInitializer + struct PrettyPrinter { - StaticInitializer () + PrettyPrinter () { String s; @@ -78,7 +91,7 @@ char const* BuildInfo::getFullVersionString () std::string fullVersionString; }; - static StaticInitializer value; + static PrettyPrinter value; return value.fullVersionString.c_str (); } diff --git a/modules/ripple_app/basics/ripple_BuildInfo.h b/modules/ripple_app/basics/ripple_BuildInfo.h index e27693660d..1a97b85dd1 100644 --- a/modules/ripple_app/basics/ripple_BuildInfo.h +++ b/modules/ripple_app/basics/ripple_BuildInfo.h @@ -20,7 +20,7 @@ struct BuildInfo The version string is formatted thusly: - '.' '.' ['-' ] + '.' ['-' ] The minor version number is always padded with leading zeroes to bring the number of characters up to exactly three. For example, @@ -52,8 +52,8 @@ struct BuildInfo /** The server version's components. */ struct Version { - int vmajor; // 0+ - int vminor; // 0-999 + int vmajor; // 0+ + int vminor; // 0-999 String suffix; // Can be empty //----