86
86
inline uint64_t hton64(uint64_t x) { return byteswap64(x); }
87
87
#endif // !WORDS_BIGENDIAN
90
std::wstring utf8ToWChar(const std::string& src);
92
std::wstring utf8ToWChar(const char* str);
94
std::string utf8ToNative(const std::string& src);
96
std::string wCharToUtf8(const std::wstring& wsrc);
98
std::string nativeToUtf8(const std::string& src);
100
# define utf8ToWChar(src) src
101
# define utf8ToNative(src) src
102
#endif // !__MINGW32__
247
264
std::string abbrevSize(int64_t size);
249
template<typename InputIterator>
266
template<typename InputIterator, typename Output>
251
(InputIterator first, InputIterator last, std::ostream& os)
268
(InputIterator first, InputIterator last, Output& os)
253
os << _("Files:") << "\n";
254
os << "idx|path/length" << "\n";
255
os << "===+===========================================================================" << "\n";
272
"===+===========================================================================\n", _("Files:"));
256
273
int32_t count = 1;
257
274
for(; first != last; ++first, ++count) {
258
os << std::setw(3) << count << "|" << (*first)->getPath() << "\n";
259
os << " |" << util::abbrevSize((*first)->getLength()) << "B ("
260
<< util::uitos((*first)->getLength(), true) << ")\n";
261
os << "---+---------------------------------------------------------------------------" << "\n";
277
"---+---------------------------------------------------------------------------\n",
279
(*first)->getPath().c_str(),
280
util::abbrevSize((*first)->getLength()).c_str(),
281
util::uitos((*first)->getLength(), true).c_str());