rippled
BuildInfo.cpp
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012, 2013 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #include <ripple/basics/contract.h>
21 #include <ripple/beast/core/SemanticVersion.h>
22 #include <ripple/protocol/BuildInfo.h>
23 
24 #include <boost/preprocessor/stringize.hpp>
25 
26 namespace ripple {
27 
28 namespace BuildInfo {
29 
30 //--------------------------------------------------------------------------
31 // The build version number. You must edit this for each release
32 // and follow the format described at http://semver.org/
33 //------------------------------------------------------------------------------
34 char const* const versionString = "1.6.0-b2"
35 
36 #if defined(DEBUG) || defined(SANITIZER)
37  "+"
38 #ifdef DEBUG
39  "DEBUG"
40 #ifdef SANITIZER
41  "."
42 #endif
43 #endif
44 
45 #ifdef SANITIZER
46  BOOST_PP_STRINGIZE(SANITIZER)
47 #endif
48 #endif
49 
50  //--------------------------------------------------------------------------
51  ;
52 
53 //
54 // Don't touch anything below this line
55 //
56 
57 std::string const&
59 {
60  static std::string const value = [] {
61  std::string const s = versionString;
63  if (!v.parse (s) || v.print () != s)
64  LogicError (s + ": Bad server version string");
65  return s;
66  }();
67  return value;
68 }
69 
71 {
72  static std::string const value =
73  "rippled-" + getVersionString();
74  return value;
75 }
76 
77 } // BuildInfo
78 
79 } // ripple
std::string
STL class.
beast::SemanticVersion::print
std::string print() const
Produce a string from semantic version components.
Definition: SemanticVersion.cpp:228
beast::SemanticVersion
A Semantic Version number.
Definition: SemanticVersion.h:35
ripple::BuildInfo::getVersionString
std::string const & getVersionString()
Server version.
Definition: BuildInfo.cpp:58
ripple::BuildInfo::getFullVersionString
std::string const & getFullVersionString()
Full server version string.
Definition: BuildInfo.cpp:70
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
beast::SemanticVersion::parse
bool parse(std::string const &input)
Parse a semantic version string.
Definition: SemanticVersion.cpp:162
ripple::BuildInfo::versionString
char const *const versionString
Definition: BuildInfo.cpp:34
ripple::LogicError
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
Definition: contract.cpp:50