[llvm-commits] CVS: llvm/lib/System/Unix/TimeValue.cpp

Reid Spencer reid at x10sys.com
Sun Nov 14 14:10:46 PST 2004



Changes in directory llvm/lib/System/Unix:

TimeValue.cpp updated: 1.1 -> 1.2
---
Log message:

Implement the toString method

---
Diffs of the changes:  (+16 -0)

Index: llvm/lib/System/Unix/TimeValue.cpp
diff -u llvm/lib/System/Unix/TimeValue.cpp:1.1 llvm/lib/System/Unix/TimeValue.cpp:1.2
--- llvm/lib/System/Unix/TimeValue.cpp:1.1	Sat Sep 25 00:03:54 2004
+++ llvm/lib/System/Unix/TimeValue.cpp	Sun Nov 14 16:10:08 2004
@@ -18,5 +18,21 @@
 
 #include "Unix.h"
 
+#include <time.h>
+
+namespace llvm {
+  using namespace sys;
+
+
+std::string TimeValue::toString() {
+  char buffer[32];
+
+  time_t ourTime = time_t(this->toEpochTime());
+  ::asctime_r(::localtime(&ourTime), buffer);
+
+  std::string result(buffer);
+  return result.substr(0,24);
+}
+
 }
 // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab






More information about the llvm-commits mailing list