aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-11-14 22:10:08 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-11-14 22:10:08 +0000
commitd351871d9b2cd7788274a47a2b8a23dbba663288 (patch)
tree968059fbaa647f5a58e71411c6178ca7664c4fdb /lib
parent944655922ea9ffc2b76382ccb8d9a958ef878df2 (diff)
Implement the toString method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17782 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/System/Unix/TimeValue.cpp16
-rw-r--r--lib/System/Unix/TimeValue.inc16
2 files changed, 32 insertions, 0 deletions
diff --git a/lib/System/Unix/TimeValue.cpp b/lib/System/Unix/TimeValue.cpp
index 1fbedcab4f..f029f8dadc 100644
--- a/lib/System/Unix/TimeValue.cpp
+++ b/lib/System/Unix/TimeValue.cpp
@@ -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
diff --git a/lib/System/Unix/TimeValue.inc b/lib/System/Unix/TimeValue.inc
index 1fbedcab4f..f029f8dadc 100644
--- a/lib/System/Unix/TimeValue.inc
+++ b/lib/System/Unix/TimeValue.inc
@@ -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