• 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"])
24
25pw_cc_library(
26    name = "pw_stream",
27    srcs = [
28        "memory_stream.cc",
29    ],
30    hdrs = [
31        "public/pw_stream/memory_stream.h",
32        "public/pw_stream/null_stream.h",
33        "public/pw_stream/seek.h",
34        "public/pw_stream/stream.h",
35    ],
36    includes = ["public"],
37    deps = [
38        "//pw_assert",
39        "//pw_bytes",
40        "//pw_polyfill",
41        "//pw_result",
42        "//pw_span",
43        "//pw_status",
44    ],
45)
46
47pw_cc_library(
48    name = "socket_stream",
49    srcs = ["socket_stream.cc"],
50    hdrs = ["public/pw_stream/socket_stream.h"],
51    deps = [
52        ":pw_stream",
53        "//pw_log",
54        "//pw_string",
55        "//pw_sys_io",
56    ],
57)
58
59pw_cc_library(
60    name = "sys_io_stream",
61    hdrs = ["public/pw_stream/sys_io_stream.h"],
62    deps = [
63        "//pw_stream",
64        "//pw_sys_io",
65    ],
66)
67
68pw_cc_library(
69    name = "std_file_stream",
70    srcs = ["std_file_stream.cc"],
71    hdrs = ["public/pw_stream/std_file_stream.h"],
72    deps = [
73        ":pw_stream",
74        "//pw_assert",
75    ],
76)
77
78pw_cc_library(
79    name = "interval_reader",
80    srcs = ["interval_reader.cc"],
81    hdrs = ["public/pw_stream/interval_reader.h"],
82    deps = [":pw_stream"],
83)
84
85pw_cc_test(
86    name = "memory_stream_test",
87    srcs = ["memory_stream_test.cc"],
88    deps = [
89        ":pw_stream",
90        "//pw_assert",
91        "//pw_status",
92        "//pw_unit_test",
93    ],
94)
95
96pw_cc_test(
97    name = "null_stream_test",
98    srcs = ["null_stream_test.cc"],
99    deps = [
100        ":pw_stream",
101        "//pw_unit_test",
102    ],
103)
104
105pw_cc_test(
106    name = "std_file_stream_test",
107    srcs = ["std_file_stream_test.cc"],
108    deps = [
109        ":std_file_stream",
110        "//pw_assert",
111        "//pw_bytes",
112        "//pw_containers",
113        "//pw_random",
114        "//pw_result",
115        "//pw_status",
116        "//pw_string",
117        "//pw_unit_test",
118    ],
119)
120
121pw_cc_test(
122    name = "seek_test",
123    srcs = ["seek_test.cc"],
124    deps = [
125        ":pw_stream",
126        "//pw_unit_test",
127    ],
128)
129
130pw_cc_test(
131    name = "stream_test",
132    srcs = ["stream_test.cc"],
133    deps = [
134        ":pw_stream",
135        "//pw_unit_test",
136    ],
137)
138
139pw_cc_test(
140    name = "interval_reader_test",
141    srcs = ["interval_reader_test.cc"],
142    deps = [
143        ":interval_reader",
144        "//pw_unit_test",
145    ],
146)
147
148pw_cc_test(
149    name = "socket_stream_test",
150    srcs = ["socket_stream_test.cc"],
151    deps = [
152        ":socket_stream",
153        "//pw_unit_test",
154    ],
155)
156