2018-12-31 20:04:05 +01:00
|
|
|
//
|
2020-01-01 02:23:48 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2020
|
2018-12-31 20:04:05 +01:00
|
|
|
//
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
//
|
2020-12-21 23:56:36 +01:00
|
|
|
#include "td/tl/tl_string_outputer.h"
|
2018-12-31 20:04:05 +01:00
|
|
|
|
|
|
|
namespace td {
|
|
|
|
namespace tl {
|
|
|
|
|
|
|
|
void tl_string_outputer::append(const std::string &str) {
|
|
|
|
result += str;
|
|
|
|
}
|
|
|
|
|
2018-09-01 16:00:28 +02:00
|
|
|
std::string tl_string_outputer::get_result() const {
|
|
|
|
#if defined(_WIN32)
|
|
|
|
std::string fixed_result;
|
|
|
|
for (std::size_t i = 0; i < result.size(); i++) {
|
|
|
|
if (result[i] == '\n') {
|
|
|
|
fixed_result += '\r';
|
|
|
|
}
|
|
|
|
fixed_result += result[i];
|
|
|
|
}
|
|
|
|
return fixed_result;
|
|
|
|
#else
|
2018-12-31 20:04:05 +01:00
|
|
|
return result;
|
2018-09-01 16:00:28 +02:00
|
|
|
#endif
|
2018-12-31 20:04:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace tl
|
|
|
|
} // namespace td
|