mirror of https://gitee.com/bigwinds/arangodb
added VPack version number
This commit is contained in:
parent
6f0be080fa
commit
79d57bf74e
|
@ -37,8 +37,6 @@
|
|||
|
||||
using namespace arangodb::rest;
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief initialize
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -55,6 +53,7 @@ void Version::initialize() {
|
|||
Values["openssl-version"] = getOpenSSLVersion();
|
||||
Values["v8-version"] = getV8Version();
|
||||
Values["libev-version"] = getLibevVersion();
|
||||
Values["vpack-version"] = getVPackVersion();
|
||||
Values["zlib-version"] = getZLibVersion();
|
||||
Values["configure"] = getConfigure();
|
||||
Values["env"] = getConfigureEnvironment();
|
||||
|
@ -80,6 +79,10 @@ void Version::initialize() {
|
|||
#else
|
||||
Values["fd-client-event-handler"] = "select";
|
||||
#endif
|
||||
|
||||
for (auto& it : Values) {
|
||||
arangodb::basics::StringUtils::trimInPlace(it.second);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -153,6 +156,14 @@ std::string Version::getLibevVersion() {
|
|||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief get vpack version
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string Version::getVPackVersion() {
|
||||
return arangodb::velocypack::Version::BuildVersion.toString();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief get zlib version
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -223,7 +234,7 @@ std::string Version::getRepositoryVersion() {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string Version::getBuildDate() {
|
||||
// the OpenSuSE build system does not liked it, if __DATE__ is used
|
||||
// the OpenSuSE build system does not like it, if __DATE__ is used
|
||||
#ifdef TRI_BUILD_DATE
|
||||
return std::string(TRI_BUILD_DATE).append(" ").append(__TIME__);
|
||||
#else
|
||||
|
@ -247,6 +258,7 @@ std::string Version::getVerboseVersionString() {
|
|||
#ifdef TRI_HAVE_TCMALLOC
|
||||
<< "tcmalloc, "
|
||||
#endif
|
||||
<< "VPack " << getVPackVersion() << ", "
|
||||
<< "ICU " << getICUVersion() << ", "
|
||||
<< "V8 " << getV8Version() << ", " << getOpenSSLVersion();
|
||||
|
||||
|
@ -261,8 +273,7 @@ std::string Version::getDetailed() {
|
|||
std::string result;
|
||||
|
||||
for (auto& it : Values) {
|
||||
std::string value = it.second;
|
||||
arangodb::basics::StringUtils::trimInPlace(value);
|
||||
std::string const& value = it.second;
|
||||
|
||||
if (!value.empty()) {
|
||||
result.append(it.first);
|
||||
|
@ -284,9 +295,8 @@ std::string Version::getDetailed() {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Version::getJson(TRI_memory_zone_t* zone, TRI_json_t* dst) {
|
||||
for (auto& it : Values) {
|
||||
std::string value = it.second;
|
||||
arangodb::basics::StringUtils::trimInPlace(value);
|
||||
for (auto const& it : Values) {
|
||||
std::string const& value = it.second;
|
||||
|
||||
if (!value.empty()) {
|
||||
std::string const& key = it.first;
|
||||
|
@ -303,9 +313,8 @@ void Version::getJson(TRI_memory_zone_t* zone, TRI_json_t* dst) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Version::getVPack(VPackBuilder& dst) {
|
||||
for (auto& it : Values) {
|
||||
std::string value = it.second;
|
||||
arangodb::basics::StringUtils::trimInPlace(value);
|
||||
for (auto const& it : Values) {
|
||||
std::string const& value = it.second;
|
||||
|
||||
if (!value.empty()) {
|
||||
dst.add(it.first, VPackValue(value));
|
||||
|
|
|
@ -27,16 +27,15 @@
|
|||
#include "Basics/Common.h"
|
||||
|
||||
#include <velocypack/Builder.h>
|
||||
#include <velocypack/Version.h>
|
||||
#include <velocypack/velocypack-aliases.h>
|
||||
|
||||
|
||||
struct TRI_json_t;
|
||||
struct TRI_memory_zone_s;
|
||||
|
||||
namespace arangodb {
|
||||
namespace rest {
|
||||
|
||||
|
||||
class Version {
|
||||
|
||||
private:
|
||||
|
@ -86,6 +85,12 @@ class Version {
|
|||
|
||||
static std::string getLibevVersion();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief get vpack version
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static std::string getVPackVersion();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief get zlib version
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -145,7 +150,6 @@ class Version {
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void getVPack(VPackBuilder&);
|
||||
|
||||
|
||||
public:
|
||||
static std::map<std::string, std::string> Values;
|
||||
|
|
Loading…
Reference in New Issue