• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15load(
16    "//pw_build:pigweed.bzl",
17    "pw_cc_library",
18    "pw_cc_test",
19)
20
21package(default_visibility = ["//visibility:public"])
22
23licenses(["notice"])  # Apache License 2.0
24
25pw_cc_library(
26    name = "pw_stream",
27    srcs = [
28        "buffered_stream.cc",
29        "memory_stream.cc",
30    ],
31    hdrs = [
32        "public/pw_stream/memory_stream.h",
33        "public/pw_stream/null_stream.h",
34        "public/pw_stream/stream.h",
35    ],
36    includes = ["public"],
37    deps = [
38        "//pw_assert",
39        "//pw_bytes",
40        "//pw_result",
41        "//pw_span",
42        "//pw_status",
43    ],
44)
45
46pw_cc_library(
47    name = "pw_stream_socket",
48    srcs = ["socket_stream.cc"],
49    hdrs = ["public/pw_stream/socket_stream.h"],
50    deps = [
51        "//pw_stream",
52        "//pw_sys_io",
53    ],
54)
55
56pw_cc_library(
57    name = "pw_stream_sys_io",
58    hdrs = ["public/pw_stream/sys_io_stream.h"],
59    deps = [
60        "//pw_stream",
61        "//pw_sys_io",
62    ],
63)
64
65pw_cc_test(
66    name = "memory_stream_test",
67    srcs = [
68        "memory_stream_test.cc",
69    ],
70    deps = [
71        ":pw_stream",
72        "//pw_unit_test",
73    ],
74)
75
76pw_cc_test(
77    name = "stream_test",
78    srcs = [
79        "stream_test.cc",
80    ],
81    deps = [
82        ":pw_stream",
83        "//pw_unit_test",
84    ],
85)
86