]> Git Repo - VerusCoin.git/commitdiff
Move `*Version()` functions to version.h/cpp
authorWladimir J. van der Laan <[email protected]>
Thu, 21 Aug 2014 14:11:05 +0000 (16:11 +0200)
committerWladimir J. van der Laan <[email protected]>
Tue, 26 Aug 2014 11:25:21 +0000 (13:25 +0200)
src/bitcoin-cli.cpp
src/qt/utilitydialog.cpp
src/rpcprotocol.cpp
src/tinyformat.h
src/util.cpp
src/util.h
src/version.cpp
src/version.h

index 0609adcab3cb5ea10f1060014c02ad0c203db3e5..10ca26ff2bc4f85079c70247dd05322c2a20759e 100644 (file)
@@ -8,6 +8,7 @@
 #include "rpcclient.h"
 #include "rpcprotocol.h"
 #include "chainparamsbase.h"
+#include "version.h"
 
 #include <boost/filesystem/operations.hpp>
 
index 5fb0da145dea2d7268018029700a905454a32e94..1a39894c9bf3232d1431bcbb403b99245bcf33a4 100644 (file)
@@ -10,9 +10,9 @@
 #include "clientmodel.h"
 #include "guiutil.h"
 
-#include "clientversion.h"
 #include "init.h"
 #include "util.h"
+#include "version.h"
 
 #include <QLabel>
 #include <QRegExp>
index 643208b3b674c12e33bf45092ee6e8254bf903b1..a4deddbed36aa85563a6f42bbb60903bc7ce107e 100644 (file)
@@ -6,6 +6,7 @@
 #include "rpcprotocol.h"
 
 #include "util.h"
+#include "version.h"
 
 #include <stdint.h>
 
index 929cb66e4d7ca8e8228ea7724dfe8c10d09fea5f..73d49a1fe4d79645894215e981ef4f5fab191996 100644 (file)
@@ -121,6 +121,7 @@ namespace tfm = tinyformat;
 #include <cassert>
 #include <iostream>
 #include <sstream>
+#include <stdexcept>
 
 #ifndef TINYFORMAT_ERROR
 #   define TINYFORMAT_ERROR(reason) assert(0 && reason)
index 606f5a60f95ad8d3127927fdf784664ad8499e73..80d27d582640089513b691a1cd60edadddc8e5eb 100644 (file)
@@ -13,7 +13,6 @@
 #include "random.h"
 #include "sync.h"
 #include "uint256.h"
-#include "version.h"
 
 #include <stdarg.h>
 
@@ -1116,30 +1115,6 @@ void SetMockTime(int64_t nMockTimeIn)
     nMockTime = nMockTimeIn;
 }
 
-string FormatVersion(int nVersion)
-{
-    if (nVersion%100 == 0)
-        return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100);
-    else
-        return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100);
-}
-
-string FormatFullVersion()
-{
-    return CLIENT_BUILD;
-}
-
-// Format the subversion field according to BIP 14 spec (https://en.bitcoin.it/wiki/BIP_0014)
-std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments)
-{
-    std::ostringstream ss;
-    ss << "/";
-    ss << name << ":" << FormatVersion(nClientVersion);
-    if (!comments.empty())
-        ss << "(" << boost::algorithm::join(comments, "; ") << ")";
-    ss << "/";
-    return ss.str();
-}
 
 #ifdef WIN32
 boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate)
index e0feca07ca90fe620500eb854cbf5b7f563e997d..cfbf30c6a4ec36a4aae4f10f0cad625401eb900b 100644 (file)
@@ -156,8 +156,6 @@ boost::filesystem::path GetTempPath();
 void ShrinkDebugFile();
 int64_t GetTime();
 void SetMockTime(int64_t nMockTimeIn);
-std::string FormatFullVersion();
-std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments);
 void runCommand(std::string strCommand);
 
 inline std::string i64tostr(int64_t n)
index d86caa3ac2e21be1811b540671921329e23f2283..8311041ed2827244c29d48cc2b7a756e465c238f 100644 (file)
@@ -4,7 +4,10 @@
 
 #include "version.h"
 
+#include "tinyformat.h"
+
 #include <string>
+#include <boost/algorithm/string/join.hpp>
 
 // Name of client reported in the 'version' message. Report the same name
 // for both bitcoind and bitcoin-qt, to make it harder for attackers to
@@ -69,3 +72,28 @@ const std::string CLIENT_NAME("Satoshi");
 
 const std::string CLIENT_BUILD(BUILD_DESC CLIENT_VERSION_SUFFIX);
 const std::string CLIENT_DATE(BUILD_DATE);
+
+static std::string FormatVersion(int nVersion)
+{
+    if (nVersion%100 == 0)
+        return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100);
+    else
+        return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100);
+}
+
+std::string FormatFullVersion()
+{
+    return CLIENT_BUILD;
+}
+
+// Format the subversion field according to BIP 14 spec (https://en.bitcoin.it/wiki/BIP_0014)
+std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments)
+{
+    std::ostringstream ss;
+    ss << "/";
+    ss << name << ":" << FormatVersion(nClientVersion);
+    if (!comments.empty())
+        ss << "(" << boost::algorithm::join(comments, "; ") << ")";
+    ss << "/";
+    return ss.str();
+}
index fbb731c91d8a7f7163b94d9d12702683f99da064..3a6c0f37193b500381c0b371a52d9718a755360b 100644 (file)
@@ -7,6 +7,7 @@
 #include "clientversion.h"
 
 #include <string>
+#include <vector>
 
 //
 // client versioning
@@ -48,4 +49,7 @@ static const int BIP0031_VERSION = 60000;
 // "mempool" command, enhanced "getdata" behavior starts with this version
 static const int MEMPOOL_GD_VERSION = 60002;
 
+std::string FormatFullVersion();
+std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments);
+
 #endif
This page took 0.042477 seconds and 4 git commands to generate.