[INIT] move VersionString code to base/version
This commit is contained in:
@@ -13,10 +13,18 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "absl/strings/str_cat.h"
|
||||
|
||||
namespace operations_research {
|
||||
|
||||
int OrToolsMajorVersion() { return OR_TOOLS_MAJOR; }
|
||||
|
||||
int OrToolsMinorVersion() { return OR_TOOLS_MINOR; }
|
||||
|
||||
int OrToolsPatchVersion() { return OR_TOOLS_PATCH; }
|
||||
|
||||
std::string OrToolsVersionString() {
|
||||
return absl::StrCat(OR_TOOLS_MAJOR, ".", OR_TOOLS_MINOR, ".", OR_TOOLS_PATCH);
|
||||
}
|
||||
|
||||
} // namespace operations_research
|
||||
|
||||
@@ -14,12 +14,18 @@
|
||||
#ifndef OR_TOOLS_BASE_VERSION_H_
|
||||
#define OR_TOOLS_BASE_VERSION_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace operations_research {
|
||||
|
||||
int OrToolsMajorVersion();
|
||||
|
||||
int OrToolsMinorVersion();
|
||||
|
||||
int OrToolsPatchVersion();
|
||||
|
||||
std::string OrToolsVersionString();
|
||||
|
||||
} // namespace operations_research
|
||||
|
||||
#endif // OR_TOOLS_BASE_VERSION_H_
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/flags/flag.h"
|
||||
#include "absl/strings/str_cat.h"
|
||||
#include "ortools/base/logging.h"
|
||||
#include "ortools/base/version.h"
|
||||
#include "ortools/gurobi/environment.h"
|
||||
@@ -153,9 +152,7 @@ class OrToolsVersion {
|
||||
* Returns the string version of OR-Tools.
|
||||
*/
|
||||
static std::string VersionString() {
|
||||
return absl::StrCat(::operations_research::OrToolsMajorVersion(), ".",
|
||||
::operations_research::OrToolsMinorVersion(), ".",
|
||||
::operations_research::OrToolsPatchVersion(), ".");
|
||||
return ::operations_research::OrToolsVersionString();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user