[go: up one dir, main page]

Menu

[ee7d4c]: / lib / lib_info.cpp  Maximize  Restore  History

Download this file

105 lines (85 with data), 2.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
/** @file "/owlcpp/lib/lib_info.cpp"
part of owlcpp project.
@n @n Distributed under the Boost Software License, Version 1.0; see doc/license.txt.
@n Copyright Mikhail K Levin 2012
*******************************************************************************/
#ifndef OWLCPP_SOURCE
#define OWLCPP_SOURCE
#endif
#include <sstream>
#include "owlcpp/lib_info.hpp"
#include "boost/preprocessor/stringize.hpp"
#ifndef OWLCPP_NAME
#define OWLCPP_NAME owlcpp
#endif
#ifndef OWLCPP_DESCRIPTION
#define OWLCPP_DESCRIPTION
#endif
#ifndef OWLCPP_VERSION_1
#define OWLCPP_VERSION_1 0
#endif
#ifndef OWLCPP_VERSION_2
#define OWLCPP_VERSION_2 0
#endif
#ifndef OWLCPP_VERSION_3
#define OWLCPP_VERSION_3 0
#endif
#ifndef OWLCPP_VERSION_EXTRA
#define OWLCPP_VERSION_EXTRA ???
#endif
#ifndef OWLCPP_VERSION_DIRTY
#define OWLCPP_VERSION_DIRTY 0
#endif
#ifndef OWLCPP_BUILD
#define OWLCPP_BUILD 0
#endif
namespace owlcpp { namespace{
std::string make_version_str() {
std::ostringstream str;
str
<< 'v' << OWLCPP_VERSION_1 << '.'
<< OWLCPP_VERSION_2 << '.' << OWLCPP_VERSION_3
;
const std::string e = std::string(BOOST_PP_STRINGIZE(OWLCPP_VERSION_EXTRA));
if( ! e.empty() ) str << '-' << e;
if( OWLCPP_VERSION_DIRTY ) str << '~';
return str.str();
}
}//namespace anonymous
/*
*******************************************************************************/
std::string const& Lib_info::name() {
static const std::string s = std::string(BOOST_PP_STRINGIZE(OWLCPP_NAME));
return s;
}
/*
*******************************************************************************/
std::string const& Lib_info::version() {
static const std::string s = make_version_str();
return s;
}
/*
*******************************************************************************/
std::string const& Lib_info::description() {
static const std::string s = std::string(BOOST_PP_STRINGIZE(OWLCPP_DESCRIPTION));
return s;
}
/*
*******************************************************************************/
int Lib_info::version_1() {return OWLCPP_VERSION_1;}
/*
*******************************************************************************/
int Lib_info::version_2() {return OWLCPP_VERSION_2;}
/*
*******************************************************************************/
int Lib_info::version_3() {return OWLCPP_VERSION_3;}
/*
*******************************************************************************/
std::string const& Lib_info::version_e() {
static const std::string s = std::string(BOOST_PP_STRINGIZE(OWLCPP_VERSION_EXTRA));
return s;
}
/*
*******************************************************************************/
int Lib_info::build() {return OWLCPP_BUILD;}
}//namespace owlcpp