]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added the method AddDateToComment, adding the current date to the comment datamember.
authorrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Mar 2010 08:56:32 +0000 (08:56 +0000)
committerrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Mar 2010 08:56:32 +0000 (08:56 +0000)
This method is supposed to be useful if called at the time when the object
is created, so that later it can more easily be tracked, in particular
when the date of the file can be lost or when one is interested in the
date of creation, irrespective of a later copy of it

STEER/AliCDBMetaData.cxx
STEER/AliCDBMetaData.h

index 4a55caa34d06ff65c96378356b0f57b7a84ba9cc..779bd5445956f10cc31389ae41ac52a925cdfba1 100644 (file)
@@ -25,6 +25,7 @@
 #include "AliLog.h"
 
 #include <TObjString.h>
+#include <TTimeStamp.h>
 
 ClassImp(AliCDBMetaData)
 
@@ -94,6 +95,22 @@ Bool_t AliCDBMetaData::RemoveProperty(const char* property) {
        }
 }
 
+//_____________________________________________________________________________
+void AliCDBMetaData::AddDateToComment() {
+// add the date to the comment.
+// This method is supposed to be useful if called at the time when the object
+// is created, so that later it can more easily be tracked, in particular
+// when the date of the file can be lost or when one is interested in the
+// date of creation, irrespective of a later copy of it
+
+       TTimeStamp ts(time(0));
+       TString comment(GetComment());
+       comment += Form("\tDate of production: %s\n", ts.AsString());
+       comment.Remove(comment.Last('+'));
+       SetComment(comment);
+
+}
+
 //_____________________________________________________________________________
 void AliCDBMetaData::PrintMetaData() {
 // print the object's metaData
index d7a4247aa12ba3e71a606f2e647d3702320c0a8e..230942870ce624b650d391ab84e1ca1198809d31 100644 (file)
@@ -46,6 +46,7 @@ public:
                                {fComment = comment;};
        const char*     GetComment() const 
                                {return fComment.Data();};
+       void            AddDateToComment();
 
        void            SetProperty(const char* property, TObject* object);
        TObject*        GetProperty(const char* property) const;