|
//____________________________________________________________________ // // // //____________________________________________________________________ // // $Id: BrVersion.cxx,v 1.1.1.1 2001/06/21 14:54:58 hagel Exp $ // $Author: hagel $ // $Date: 2001/06/21 14:54:58 $ // $Copyright: (C) 2001 BRAHMS Collaboration <brahmlib@rhic.bnl.gov> // #ifndef BRAT_BrVersion #include "BrVersion.h" #endif #ifndef ROOT_TString #include "TString.h" #endif #ifndef WIN32 #include <cstdlib> #include <iostream> #else #include <stdlib.h> #include <iostream.h> #endif // #ifndef VERSION // #define VERSION "0.0.0" // #endif #ifndef MAJOR #define MAJOR 0 #endif #ifndef MINOR #define MINOR 0 #endif #ifndef REVISION #define REVISION 0 #endif //____________________________________________________________________ ClassImp(BrVersion); //____________________________________________________________________ BrVersion::BrVersion() { // Default constructor fMajor = MAJOR; fMinor = MINOR; fRevision = REVISION; #if 0 TString verStr(VERSION); Ssiz_t dotIndex = 0; Sziz_t oldIndex = 0; dotIndex = verStr.Index(".", oldIndex); fMajor = strtol(verStr(oldIndex,dotIndex - oldIndex).Data()); oldIndex = dotIndex + 1; dotIndex = verStr.Index(".", oldIndex); fMinor = strtol(verStr(oldIndex,dotIndex - oldIndex).Data()); oldIndex = dotIndex + 1; dotIndex = verStr.Length(); fRevision = strtol(verStr(oldIndex,dotIndex - oldIndex).Data()); #endif char cpp_mm[4]; int cpp_yy = 0; int cpp_dd = 0; int cpp_hh = 0; int cpp_mi = 0; int cpp_ss = 0; if (sscanf(__DATE__, "%s %d %d", cpp_mm, &cpp_dd, &cpp_yy) != 3) Error("BrVersion", "couldn't extract date information"); if (sscanf(__TIME__, "%d:%d:%d", &cpp_hh, &cpp_mi, &cpp_ss) != 3) Error("BrVersion", "couldn't extract time information"); int cpp_mm_int = 0; if (strcmp(cpp_mm, "Jan")) cpp_mm_int = 1; else if (strcmp(cpp_mm, "Feb")) cpp_mm_int = 2; else if (strcmp(cpp_mm, "Mar")) cpp_mm_int = 3; else if (strcmp(cpp_mm, "Apr")) cpp_mm_int = 4; else if (strcmp(cpp_mm, "May")) cpp_mm_int = 5; else if (strcmp(cpp_mm, "Jun")) cpp_mm_int = 6; else if (strcmp(cpp_mm, "Jul")) cpp_mm_int = 7; else if (strcmp(cpp_mm, "Aug")) cpp_mm_int = 8; else if (strcmp(cpp_mm, "Sep")) cpp_mm_int = 9; else if (strcmp(cpp_mm, "Oct")) cpp_mm_int = 10; else if (strcmp(cpp_mm, "Nov")) cpp_mm_int = 11; else if (strcmp(cpp_mm, "Dec")) cpp_mm_int = 12; else Error("BrVersion", "Unknown month '%s'", cpp_mm); fTime.Set(cpp_yy, cpp_mm_int, cpp_dd, cpp_hh, cpp_mi, cpp_ss); } //____________________________________________________________________ const Char_t* BrVersion::AsString() const { return Form("%d.%02d/%02d", fMajor, fMinor, fRevision); } //____________________________________________________________________ void BrVersion::Print(Option_t* option) const { // Print the version information // Options: // V Version number (default) // D Date/Time of compilation (this class) TString opt(option); opt.ToLower(); if (opt.Contains("v")) cout << " BRAT Version: " << AsString() << endl; if (opt.Contains("d")) cout << " BRAT Date: " << fTime.AsString() << endl; } //____________________________________________________________________ // // $Log: BrVersion.cxx,v $ // Revision 1.1.1.1 2001/06/21 14:54:58 hagel // Initial revision of brat2 // // Revision 1.1 2001/06/04 13:34:25 cholm // Warm-up for BRAT2. // Added file tag class. Added version class. Added path manager. // // |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|