Mercurial > hg > svcore
comparison base/RealTime.cpp @ 121:7c3e1bc51080
* RFE 1497743: Adjust layer text file format to allow copy/paste into Excel
Use \t as the default separator for text file export, and remove the leading
space from RealTime::toString values
author | Chris Cannam |
---|---|
date | Thu, 08 Jun 2006 11:12:47 +0000 |
parents | fda016f64f7c |
children | 4b2ea82fd0ed |
comparison
equal
deleted
inserted
replaced
120:e388730429b5 | 121:7c3e1bc51080 |
---|---|
100 out << n << "R"; | 100 out << n << "R"; |
101 return out; | 101 return out; |
102 } | 102 } |
103 | 103 |
104 std::string | 104 std::string |
105 RealTime::toString() const | 105 RealTime::toString(bool align) const |
106 { | 106 { |
107 std::stringstream out; | 107 std::stringstream out; |
108 out << *this; | 108 out << *this; |
109 | 109 |
110 #if (__GNUC__ < 3) | 110 #if (__GNUC__ < 3) |
111 out << std::ends; | 111 out << std::ends; |
112 #endif | 112 #endif |
113 | 113 |
114 std::string s = out.str(); | 114 std::string s = out.str(); |
115 | |
116 if (!align && *this >= RealTime::zeroTime) { | |
117 // remove leading " " | |
118 s = s.substr(1, s.length() - 1); | |
119 } | |
115 | 120 |
116 // remove trailing R | 121 // remove trailing R |
117 return s.substr(0, s.length() - 1); | 122 return s.substr(0, s.length() - 1); |
118 } | 123 } |
119 | 124 |