Changeset 620 for trunk


Ignore:
Timestamp:
Apr 23, 2008, 2:43:10 AM (13 years ago)
Author:
Peter Johansson
Message:

Made version string (in parenthesis) a function that is called from footer and function creating --version output. PP Macro TIME and DATE were moved to subversion_info.cc. For details about why see comment in subversion_info.h

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/Parameter.cc

    r619 r620  
    263263    ColumnStream cs(std::cout, 1);
    264264    cs.width(0)=79;
    265     cs << PACKAGE_STRING;
    266     cs << " (";
    267     if (DEV_BUILD)
    268       cs << "r" << svn_revision() << " ";
    269     cs << "compiled " << __DATE__ ", " << __TIME__ << ")\n";
    270    
     265    cs << PACKAGE_STRING << version_string() << "\n";
    271266    cs << "\nCopyright (C) " << svn_year()
    272267       << " Jari H\u00E4kkinen and Peter Johansson.\n"
  • trunk/lib/html_utility.cc

    r589 r620  
    6868       << anchor("http://trac.thep.lu.se/svndigest/",
    6969                 PACKAGE_STRING, 0, "");
    70     if (DEV_BUILD)
    71       os << " (r" << svn_revision() << ")";
     70    os << version_string() << "\n";
    7271    os << "\n</p>\n</div>\n</body>\n</html>\n";
    7372  }
  • trunk/lib/subversion_info.cc.in

    r581 r620  
    2828namespace svndigest{
    2929
     30  std::string compilation_date(void)
     31  {
     32    return __DATE__;
     33  }
     34
     35
     36  std::string compilation_time(void)
     37  {
     38    return __TIME__;
     39  }
     40
     41
    3042  std::string svn_revision(void)
    3143  {
  • trunk/lib/subversion_info.h

    r569 r620  
    3030namespace svndigest{
    3131
     32  // This functions are (mis)placed here to reflect compilation time
     33  // of subversion_info.cc. Previously, __TIME__ macro was placed in
     34  // `bin/Parameter.cc' and since the Parameter is almost independent
     35  // of other parts of the package, that compilation time does not
     36  // very accurately reflect the building time of the svndigest
     37  // binary. subversion_info.cc is at least modified when updating
     38  // against repository and therefore these functions will return a
     39  // time no earlier than last `svn update'
     40  std::string compilation_date(void);
     41  std::string compilation_time(void);
     42
    3243  std::string svn_revision(void);
    3344
  • trunk/lib/utility.cc

    r589 r620  
    2323
    2424#include "utility.h"
     25
     26#include "subversion_info.h"
     27#include "config.h"
    2528
    2629#include <cassert>
     
    321324
    322325
     326  std::string version_string(void)
     327  {
     328    std::stringstream ss;
     329    ss << " (";
     330    if (DEV_BUILD)
     331      ss << "r" << svn_revision() << " ";
     332    ss << "compiled " << compilation_time() << ", " << compilation_date()
     333       << ")";
     334    return ss.str();
     335  }
     336
     337
    323338  std::string match(std::string::const_iterator& first,
    324339                    const std::string::const_iterator& last,
  • trunk/lib/utility.h

    r589 r620  
    200200  inline std::string trim(std::string str) { return htrim(ltrim(str)); }
    201201
     202  ///
     203  /// \return string with version info
     204  ///
     205  std::string version_string(void);
     206 
    202207
    203208  template <typename T>
Note: See TracChangeset for help on using the changeset viewer.