Skip to content

Commit c970e66

Browse files
committed
migrate to @org_iceboy_trunk//io:native-file
1 parent b8e4d16 commit c970e66

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

WORKSPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ boost_deps()
5454

5555
git_repository(
5656
name = "org_iceboy_trunk",
57-
commit = "d15780f227aba09dafd471a9855beeb47e21e070",
57+
commit = "0be2a93fa780f608f8bfffa48a5e0367a5c08605",
5858
remote = "https://github.com/iceboy233/trunk.git",
5959
)

net/tools/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ cc_binary(
1616
deps = [
1717
"@org_iceboy_trunk//base:flags",
1818
"@org_iceboy_trunk//base:logging",
19+
"@org_iceboy_trunk//io:native-file",
1920
"@org_iceboy_trunk//io:stream",
20-
"@org_iceboy_trunk//io/posix:file",
2121
"@org_iceboy_trunk//net:asio",
2222
"@org_iceboy_trunk//net:asio-flags",
2323
"@org_iceboy_trunk//net:blocking-result",
@@ -46,7 +46,7 @@ cc_binary(
4646
"@org_iceboy_trunk//base:flags",
4747
"@org_iceboy_trunk//base:logging",
4848
"@org_iceboy_trunk//io:file-utils",
49-
"@org_iceboy_trunk//io/posix:file",
49+
"@org_iceboy_trunk//io:native-file",
5050
"@org_iceboy_trunk//net:asio",
5151
"@org_iceboy_trunk//net:blocking-result",
5252
"@org_iceboy_trunk//net:endpoint",

net/tools/icmp-scanner.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "base/flags.h"
22
#include "base/logging.h"
3-
#include "io/posix/file.h"
3+
#include "io/native-file.h"
44
#include "io/stream.h"
55
#include "net/asio.h"
66
#include "net/asio-flags.h"
@@ -68,7 +68,7 @@ int main(int argc, char *argv[]) {
6868
auto executor = io_context.get_executor();
6969
IcmpClient icmp_client(executor, {});
7070
steady_timer timer(executor);
71-
io::OStream os(io::posix::stdout);
71+
io::OStream os(io::std_output());
7272
int64_t pending_requests = 0;
7373
if (flags::from.is_v4()) {
7474
address_v4_iterator first(flags::from.to_v4());

net/tools/rpc-client.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "base/logging.h"
1313
#include "flatbuffers/idl.h"
1414
#include "io/file-utils.h"
15-
#include "io/posix/file.h"
15+
#include "io/native-file.h"
1616
#include "net/asio.h"
1717
#include "net/blocking-result.h"
1818
#include "net/endpoint.h"
@@ -51,7 +51,7 @@ int main(int argc, char *argv[]) {
5151
parser.Parse(schema.c_str());
5252
parser.SetRootType(flags::request_type.c_str());
5353
std::string request_json;
54-
ec = read_to_end(io::posix::stdin, request_json);
54+
ec = read_to_end(io::std_input(), request_json);
5555
if (ec) {
5656
LOG(fatal) << "read failed: " << ec;
5757
return 1;
@@ -90,7 +90,7 @@ int main(int argc, char *argv[]) {
9090
<< std::get<0>(result.args());
9191
return 1;
9292
}
93-
ec = write(io::posix::stdout, response_json);
93+
ec = write(io::std_output(), response_json);
9494
if (ec) {
9595
LOG(fatal) << "write failed: " << ec;
9696
return 1;

sys/tools/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ cc_binary(
55
"@com_google_absl//absl/strings",
66
"@org_iceboy_trunk//base:flags",
77
"@org_iceboy_trunk//io:file-utils",
8-
"@org_iceboy_trunk//io/posix:file",
8+
"@org_iceboy_trunk//io:native-file",
99
]
1010
)

sys/tools/base64.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "absl/strings/escaping.h"
66
#include "base/flags.h"
77
#include "io/file-utils.h"
8-
#include "io/posix/file.h"
8+
#include "io/native-file.h"
99

1010
DEFINE_FLAG(bool, d, false, "Decode.");
1111
DEFINE_FLAG(bool, url, false, "Use URL encoding.");
@@ -20,7 +20,7 @@ std::error_code encode() {
2020

2121
size_t size;
2222
do {
23-
std::error_code ec = read(io::posix::stdin, src, size);
23+
std::error_code ec = read(io::std_input(), src, size);
2424
if (ec) {
2525
return ec;
2626
}
@@ -29,7 +29,7 @@ std::error_code encode() {
2929
} else {
3030
absl::WebSafeBase64Escape({src.data(), size}, &dest);
3131
}
32-
ec = write(io::posix::stdout, dest);
32+
ec = write(io::std_output(), dest);
3333
if (ec) {
3434
return ec;
3535
}
@@ -44,7 +44,7 @@ std::error_code decode() {
4444

4545
size_t size;
4646
do {
47-
std::error_code ec = read(io::posix::stdin, src, size);
47+
std::error_code ec = read(io::std_input(), src, size);
4848
if (ec) {
4949
return ec;
5050
}
@@ -57,7 +57,7 @@ std::error_code decode() {
5757
if (!success) {
5858
return make_error_code(std::errc::bad_message);
5959
}
60-
ec = write(io::posix::stdout, dest);
60+
ec = write(io::std_output(), dest);
6161
if (ec) {
6262
return ec;
6363
}

0 commit comments

Comments
 (0)