26 #ifndef NFD_TOOLS_NFDC_FORMAT_HELPERS_HPP 27 #define NFD_TOOLS_NFDC_FORMAT_HELPERS_HPP 94 Separator(
const std::string& first,
const std::string& subsequent);
107 std::string m_subsequent;
140 ItemAttributes(
bool wantMultiLine =
false,
int maxAttributeWidth = 0);
152 operator()(
const std::string& attribute);
158 bool m_wantMultiLine;
159 int m_maxAttributeWidth;
170 template<
typename DurationT>
176 getTimeUnit<time::nanoseconds>(
bool isLong)
178 return isLong ?
"nanoseconds" :
"ns";
183 getTimeUnit<time::microseconds>(
bool isLong)
185 return isLong ?
"microseconds" :
"us";
190 getTimeUnit<time::milliseconds>(
bool isLong)
192 return isLong ?
"milliseconds" :
"ms";
197 getTimeUnit<time::seconds>(
bool isLong)
199 return isLong ?
"seconds" :
"s";
204 getTimeUnit<time::minutes>(
bool isLong)
206 return isLong ?
"minutes" :
"m";
211 getTimeUnit<time::hours>(
bool isLong)
213 return isLong ?
"hours" :
"h";
218 getTimeUnit<time::days>(
bool isLong)
220 return isLong ?
"days" :
"d";
225 template<
typename OutputPrecision>
229 return to_string(time::duration_cast<OutputPrecision>(d).count()) +
230 (isLong ?
" " :
"") + detail::getTimeUnit<OutputPrecision>(isLong);
242 #endif // NFD_TOOLS_NFDC_FORMAT_HELPERS_HPP
std::string getTimeUnit(bool isLong)
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
print attributes of an item
int nSpaces
number of spaces; print nothing if negative
print different string on first and subsequent usage
print a number of whitespaces