crawlserv++  [under development]
Application for crawling and analyzing textual content of websites.
crawlservpp::Helper::Versions Namespace Reference

Namespace for functions getting the versions of the different libraries used by the application. More...

Typedefs

using StringString = std::pair< std::string, std::string >
 A pair of strings. More...
 

Constants

constexpr auto asioMajor {100000}
 Divisor to retrieve the major version of the Asio library. More...
 
constexpr auto asioMinor {100}
 Divisor to retrieve the minor version of the Asio library. More...
 
constexpr auto asioModMinor {1000}
 Mod divisor to retrieve the minor version of the Asio library. More...
 
constexpr auto asioPatch {100}
 Mod divisor to retrieve the patch version of the Asio library. More...
 
constexpr auto boostMajor {100000}
 Divisor to retrieve the major version of the Boost library. More...
 
constexpr auto boostMinor {1000}
 Divisor to retrieve the minor version of the Boost library. More...
 
constexpr auto boostPatch {100}
 Mod divisor to retrieve the patch level of the Boost library. More...
 
constexpr auto pugixmlMajor {100}
 Divisor to retrieve the major version of the pugixml library. More...
 
constexpr auto pugixmlMinor {10}
 Divisor to retrieve the minor version of the pugixml library. More...
 
constexpr std::array tomotoVersionFile
 The path from where to read the version of the tomoto library from. More...
 
constexpr auto tomotoVersionBegin {"__version__ = '"sv}
 The beginning of the line containing the version of the tomoto library. More...
 
constexpr auto tomotoVersionEnd {"'"sv}
 The end of the line containing the version of the tomoto library. More...
 
constexpr std::string_view utf8CppVersion {"2.1"}
 The version of the UTF8-CPP library. More...
 

Getters

std::vector< StringStringgetLibraryVersions ()
 Gets the versions of the used libraries. More...
 
std::string getLibraryVersionsStr (const std::string &indent)
 Gets the versions of the used libraries as one indented string. More...
 
std::string getTomotoVersion ()
 Gets the version of the tomoto library if available. More...
 

Detailed Description

Namespace for functions getting the versions of the different libraries used by the application.

Typedef Documentation

◆ StringString

using crawlservpp::Helper::Versions::StringString = typedef std::pair<std::string, std::string>

A pair of strings.

Function Documentation

◆ getLibraryVersions()

std::vector< StringString > crawlservpp::Helper::Versions::getLibraryVersions ( )
inline

Gets the versions of the used libraries.

Returns
The versions of the libraries as [name, version] pairs.

References asioMajor, asioMinor, asioModMinor, asioPatch, boostMajor, boostMinor, boostPatch, getTomotoVersion(), pugixmlMajor, pugixmlMinor, and utf8CppVersion.

Referenced by getLibraryVersionsStr(), and crawlservpp::Main::Database::update().

◆ getLibraryVersionsStr()

std::string crawlservpp::Helper::Versions::getLibraryVersionsStr ( const std::string &  indent)
inline

Gets the versions of the used libraries as one indented string.

Parameters
indentConstant reference to a string containing the indent to be added in front of each line.
Returns
A copy of a string containing the versions of the libraries with one (indented) line for each library.

References getLibraryVersions().

Referenced by crawlservpp::Main::App::run().

◆ getTomotoVersion()

std::string crawlservpp::Helper::Versions::getTomotoVersion ( )
inline

Gets the version of the tomoto library if available.

Returns
The version of the tomoto library as string, or <unknown> if not available.

References crawlservpp::Helper::FileSystem::getPathSeparator(), tomotoVersionBegin, tomotoVersionEnd, and tomotoVersionFile.

Referenced by getLibraryVersions(), crawlservpp::Data::TopicModel::getModelInfo(), and crawlservpp::Data::TopicModel::startTraining().

Variable Documentation

◆ asioMajor

constexpr auto crawlservpp::Helper::Versions::asioMajor {100000}
inline

Divisor to retrieve the major version of the Asio library.

Referenced by getLibraryVersions().

◆ asioMinor

constexpr auto crawlservpp::Helper::Versions::asioMinor {100}
inline

Divisor to retrieve the minor version of the Asio library.

Referenced by getLibraryVersions().

◆ asioModMinor

constexpr auto crawlservpp::Helper::Versions::asioModMinor {1000}
inline

Mod divisor to retrieve the minor version of the Asio library.

Referenced by getLibraryVersions().

◆ asioPatch

constexpr auto crawlservpp::Helper::Versions::asioPatch {100}
inline

Mod divisor to retrieve the patch version of the Asio library.

Referenced by getLibraryVersions().

◆ boostMajor

constexpr auto crawlservpp::Helper::Versions::boostMajor {100000}
inline

Divisor to retrieve the major version of the Boost library.

Referenced by getLibraryVersions().

◆ boostMinor

constexpr auto crawlservpp::Helper::Versions::boostMinor {1000}
inline

Divisor to retrieve the minor version of the Boost library.

Referenced by getLibraryVersions().

◆ boostPatch

constexpr auto crawlservpp::Helper::Versions::boostPatch {100}
inline

Mod divisor to retrieve the patch level of the Boost library.

Referenced by getLibraryVersions().

◆ pugixmlMajor

constexpr auto crawlservpp::Helper::Versions::pugixmlMajor {100}
inline

Divisor to retrieve the major version of the pugixml library.

Referenced by getLibraryVersions().

◆ pugixmlMinor

constexpr auto crawlservpp::Helper::Versions::pugixmlMinor {10}
inline

Divisor to retrieve the minor version of the pugixml library.

Referenced by getLibraryVersions().

◆ tomotoVersionBegin

constexpr auto crawlservpp::Helper::Versions::tomotoVersionBegin {"__version__ = '"sv}
inline

The beginning of the line containing the version of the tomoto library.

Referenced by getTomotoVersion().

◆ tomotoVersionEnd

constexpr auto crawlservpp::Helper::Versions::tomotoVersionEnd {"'"sv}
inline

The end of the line containing the version of the tomoto library.

Referenced by getTomotoVersion().

◆ tomotoVersionFile

constexpr std::array crawlservpp::Helper::Versions::tomotoVersionFile
inline
Initial value:
{
"src"sv,
"_extern"sv,
"tomotopy"sv,
"tomotopy"sv,
"_version.py"sv
}

The path from where to read the version of the tomoto library from.

Referenced by getTomotoVersion().

◆ utf8CppVersion

constexpr std::string_view crawlservpp::Helper::Versions::utf8CppVersion {"2.1"}
inline

The version of the UTF8-CPP library.

Warning
Hard-coded version information might not be accurate!

Referenced by getLibraryVersions().