Home
last modified time | relevance | path

Searched refs:StatusWithSize (Results 1 – 25 of 71) sorted by relevance

123

/external/pigweed/pw_status/
Dstatus_with_size_test.cc22 static_assert(StatusWithSize::max_size() ==
26 TEST(StatusWithSize, Default) { in TEST() argument
27 StatusWithSize result; in TEST()
33 TEST(StatusWithSize, ConstructWithSize) { in TEST() argument
34 StatusWithSize result = StatusWithSize(456); in TEST()
40 TEST(StatusWithSize, ConstructWithError) { in TEST() argument
41 StatusWithSize result(Status::ResourceExhausted(), 123); in TEST()
47 TEST(StatusWithSize, ConstructWithOkAndSize) { in TEST() argument
48 StatusWithSize result(Status(), 99); in TEST()
54 TEST(StatusWithSize, ConstructFromConstant) { in TEST() argument
[all …]
Dtry_test.cc23 StatusWithSize ReturnStatusWithSize(StatusWithSize status) { return status; } in ReturnStatusWithSize()
33 Status TryStatus(StatusWithSize status) { in TryStatus()
52 StatusWithSize val(OkStatus(), 0); in TEST()
59 StatusWithSize val(Status::DataLoss(), i); in TEST()
66 EXPECT_EQ(TryStatus(StatusWithSize::Cancelled()), Status::Cancelled()); in TEST()
67 EXPECT_EQ(TryStatus(StatusWithSize::DataLoss()), Status::DataLoss()); in TEST()
68 EXPECT_EQ(TryStatus(StatusWithSize::Unimplemented()), in TEST()
72 Status TryStatusAssign(size_t& size_val, StatusWithSize status) { in TryStatusAssign()
85 StatusWithSize val(OkStatus(), i); in TEST()
95 StatusWithSize val(Status::OutOfRange(), i); in TEST()
[all …]
/external/pigweed/pw_status/public/pw_status/
Dstatus_with_size.h48 class StatusWithSize {
50 static constexpr StatusWithSize Cancelled(size_t size = 0) {
51 return StatusWithSize(Status::Cancelled(), size);
53 static constexpr StatusWithSize Unknown(size_t size = 0) {
54 return StatusWithSize(Status::Unknown(), size);
56 static constexpr StatusWithSize InvalidArgument(size_t size = 0) {
57 return StatusWithSize(Status::InvalidArgument(), size);
59 static constexpr StatusWithSize DeadlineExceeded(size_t size = 0) {
60 return StatusWithSize(Status::DeadlineExceeded(), size);
62 static constexpr StatusWithSize NotFound(size_t size = 0) {
[all …]
Dtry.h58 constexpr Status ConvertToStatus(StatusWithSize status_with_size) { in ConvertToStatus()
62 constexpr StatusWithSize ConvertToStatusWithSize(Status status) { in ConvertToStatusWithSize()
63 return StatusWithSize(status, 0); in ConvertToStatusWithSize()
66 constexpr StatusWithSize ConvertToStatusWithSize( in ConvertToStatusWithSize()
67 StatusWithSize status_with_size) { in ConvertToStatusWithSize()
/external/pigweed/pw_kvs/
Dalignment.cc21 StatusWithSize AlignedWriter::Write(std::span<const std::byte> data) { in Write()
30 return StatusWithSize(bytes_written_); in Write()
33 StatusWithSize AlignedWriter::Flush() { in Flush()
49 const StatusWithSize result(status, bytes_written_); in Flush()
54 StatusWithSize AlignedWriter::Write(Input& input, size_t size) { in Write()
57 StatusWithSize result = input.Read(buffer_ + bytes_in_buffer_, to_read); in Write()
59 return StatusWithSize(result.status(), bytes_written_); in Write()
65 return StatusWithSize(bytes_written_); in Write()
68 StatusWithSize AlignedWriter::AddBytesToBuffer(size_t bytes_added) { in AddBytesToBuffer()
73 StatusWithSize result = output_.Write(buffer_, write_size_); in AddBytesToBuffer()
[all …]
Dfake_flash_memory.cc82 StatusWithSize FakeFlashMemory::Read(Address address, in Read()
85 return StatusWithSize::OutOfRange(); in Read()
91 return StatusWithSize(status, output.size()); in Read()
94 StatusWithSize FakeFlashMemory::Write(Address address, in Write()
102 return StatusWithSize::InvalidArgument(); in Write()
109 return StatusWithSize::InvalidArgument(); in Write()
118 return StatusWithSize::OutOfRange(); in Write()
126 return StatusWithSize::Unknown(); in Write()
133 return StatusWithSize(status, data.size()); in Write()
Dalignment_test.cc137 return StatusWithSize(data.size()); in __anon09f571600202()
173 return StatusWithSize(data.size()); in TEST()
194 StatusWithSize DoWrite(std::span<const byte> data) override { in DoWrite()
197 return StatusWithSize(data.size()); in DoWrite()
205 return StatusWithSize::Unknown(data.size()); in DoWrite()
228 return StatusWithSize(return_status, data.size()); in TEST()
233 StatusWithSize result = in TEST()
251 [](std::span<const byte> data) { return StatusWithSize(data.size()); }); in TEST()
258 StatusWithSize result = writer.Flush(); in TEST()
265 return StatusWithSize::Aborted(data.size()); in TEST()
[all …]
Dflash_memory.cc34 StatusWithSize FlashPartition::Output::DoWrite(std::span<const byte> data) { in DoWrite()
37 return StatusWithSize(data.size()); in DoWrite()
40 StatusWithSize FlashPartition::Input::DoRead(std::span<byte> data) { in DoRead()
41 StatusWithSize result = flash_.Read(address_, data); in DoRead()
80 StatusWithSize FlashPartition::Read(Address address, std::span<byte> output) { in Read()
85 StatusWithSize FlashPartition::Write(Address address, in Write()
88 return StatusWithSize::PermissionDenied(); in Write()
/external/pigweed/pw_string/
Dtype_to_string.cc50 StatusWithSize HandleExhaustedBuffer(std::span<char> buffer) { in HandleExhaustedBuffer()
54 return StatusWithSize::ResourceExhausted(); in HandleExhaustedBuffer()
75 StatusWithSize IntToString(uint64_t value, std::span<char> buffer) { in IntToString()
110 return StatusWithSize(total_digits); in IntToString()
113 StatusWithSize IntToHexString(uint64_t value, in IntToHexString()
128 return StatusWithSize(digits); in IntToHexString()
132 StatusWithSize IntToString(int64_t value, std::span<char> buffer) { in IntToString()
143 return StatusWithSize(result.size() + 1); in IntToString()
151 StatusWithSize FloatAsIntToString(float value, std::span<char> buffer) { in FloatAsIntToString()
166 return StatusWithSize(written); in FloatAsIntToString()
[all …]
Dformat.cc21 StatusWithSize Format(std::span<char> buffer, const char* format, ...) { in Format()
24 const StatusWithSize result = FormatVaList(buffer, format, args); in Format()
30 StatusWithSize FormatVaList(std::span<char> buffer, in FormatVaList()
34 return StatusWithSize::ResourceExhausted(); in FormatVaList()
43 return StatusWithSize::InvalidArgument(); in FormatVaList()
48 return StatusWithSize::ResourceExhausted(buffer.size() - 1); in FormatVaList()
51 return StatusWithSize(result); in FormatVaList()
/external/pigweed/pw_string/public/pw_string/
Dtype_to_string.h58 StatusWithSize IntToString(T value, std::span<char> buffer) { in IntToString()
67 StatusWithSize IntToString(uint64_t value, std::span<char> buffer);
70 StatusWithSize IntToString(int64_t value, std::span<char> buffer);
75 StatusWithSize IntToHexString(uint64_t value,
98 StatusWithSize FloatAsIntToString(float value, std::span<char> buffer);
101 StatusWithSize BoolToString(bool value, std::span<char> buffer);
108 StatusWithSize PointerToString(const void* pointer, std::span<char> buffer);
115 StatusWithSize CopyString(const std::string_view& value,
118 inline StatusWithSize CopyString(const char* value, std::span<char> buffer) { in CopyString()
131 StatusWithSize CopyEntireString(const std::string_view& value,
[all …]
Dto_string.h67 StatusWithSize ToString(const T& value, std::span<char> buffer) { in ToString()
91 inline StatusWithSize ToString(Status status, std::span<char> buffer) { in ToString()
95 inline StatusWithSize ToString(pw_Status status, std::span<char> buffer) { in ToString()
99 inline StatusWithSize ToString(std::byte byte, std::span<char> buffer) { in ToString()
/external/pigweed/pw_kvs/public/pw_kvs/
Dio.h40 StatusWithSize Write(std::span<const std::byte> data) {
45 StatusWithSize Write(const void* data, size_t size_bytes) {
54 virtual StatusWithSize DoWrite(std::span<const std::byte> data) = 0;
59 StatusWithSize Read(std::span<std::byte> data) { return DoRead(data); }
62 StatusWithSize Read(void* data, size_t size_bytes) {
71 virtual StatusWithSize DoRead(std::span<std::byte> data) = 0;
77 OutputToFunction(StatusWithSize (*function)(std::span<const std::byte>))
81 StatusWithSize DoWrite(std::span<const std::byte> data) override {
85 StatusWithSize (*function_)(std::span<const std::byte>);
Dalignment.h72 StatusWithSize Write(std::span<const std::byte> data);
74 StatusWithSize Write(const void* data, size_t size) { in Write()
80 StatusWithSize Write(Input& input, size_t size);
85 StatusWithSize Flush();
90 StatusWithSize AddBytesToBuffer(size_t bytes_added);
115 StatusWithSize AlignedWrite(Output& output, in AlignedWrite()
121 return StatusWithSize::Internal(); in AlignedWrite()
127 StatusWithSize result = buffer.Write(chunk); in AlignedWrite()
138 StatusWithSize AlignedWrite( in AlignedWrite()
Dflash_memory.h79 virtual StatusWithSize Read(Address address, std::span<std::byte> output) = 0;
81 StatusWithSize Read(Address address, void* buffer, size_t len) { in Read()
92 virtual StatusWithSize Write(Address destination_flash_address,
95 StatusWithSize Write(Address destination_flash_address, in Write()
150 StatusWithSize DoWrite(std::span<const std::byte> data) override;
163 StatusWithSize DoRead(std::span<std::byte> data) override;
208 virtual StatusWithSize Read(Address address, std::span<std::byte> output);
210 StatusWithSize Read(Address address, size_t length, void* output) { in Read()
223 virtual StatusWithSize Write(Address address,
/external/pigweed/pw_sys_io/
Dsys_io.cc19 StatusWithSize ReadBytes(std::span<std::byte> dest) { in ReadBytes()
23 return StatusWithSize(result, i); in ReadBytes()
26 return StatusWithSize(dest.size_bytes()); in ReadBytes()
29 StatusWithSize WriteBytes(std::span<const std::byte> src) { in WriteBytes()
33 return StatusWithSize(result, i); in WriteBytes()
36 return StatusWithSize(src.size_bytes()); in WriteBytes()
/external/pigweed/pw_sys_io/public/pw_sys_io/
Dsys_io.h85 StatusWithSize WriteLine(const std::string_view& s);
99 StatusWithSize ReadBytes(std::span<std::byte> dest);
113 StatusWithSize WriteBytes(std::span<const std::byte> src);
/external/pigweed/pw_stream/
Dmemory_stream.cc39 StatusWithSize MemoryReader::DoRead(ByteSpan dest) { in DoRead()
41 return StatusWithSize::OutOfRange(); in DoRead()
50 return StatusWithSize(bytes_to_read); in DoRead()
/external/pigweed/pw_rpc/nanopb/
Dnanopb_common.cc35 StatusWithSize NanopbMethodSerde::Encode(NanopbMessageDescriptor fields, in Encode()
41 return StatusWithSize::Internal(); in Encode()
44 return StatusWithSize(output.bytes_written); in Encode()
Dmethod_lookup_test.cc25 StatusWithSize TestRpc(ServerContext&, ConstByteSpan, ByteSpan) { in TestRpc()
26 return StatusWithSize(123); in TestRpc()
55 StatusWithSize sws = context.call({}); in TEST()
/external/pigweed/pw_rpc/raw/
Draw_method_test.cc36 StatusWithSize Unary(ServerContext&, ConstByteSpan, ByteSpan) { in Unary()
37 return StatusWithSize(0); in Unary()
40 static StatusWithSize StaticUnary(ServerContext&, ConstByteSpan, ByteSpan) { in StaticUnary()
41 return StatusWithSize(0); in StaticUnary()
50 StatusWithSize UnaryWrongArg(ServerContext&, ConstByteSpan, ConstByteSpan) { in UnaryWrongArg()
51 return StatusWithSize(0); in UnaryWrongArg()
112 StatusWithSize AddFive(ServerContext&, in AddFive()
123 return StatusWithSize::Unauthenticated(payload.size()); in AddFive()
/external/pigweed/pw_sys_io_stdio/
Dsys_io.cc46 StatusWithSize WriteLine(const std::string_view& s) { in WriteLine()
48 StatusWithSize size_result = WriteBytes(std::as_bytes(std::span(s))); in WriteLine()
60 return StatusWithSize(result, chars_written); in WriteLine()
/external/pigweed/pw_sys_io_arduino/
Dsys_io_arduino.cc55 StatusWithSize WriteLine(const std::string_view& s) { in WriteLine()
57 StatusWithSize result = WriteBytes(std::as_bytes(std::span(s))); in WriteLine()
67 return StatusWithSize(result.status(), chars_written); in WriteLine()
/external/pigweed/pw_rpc/nanopb/public/pw_rpc/internal/
Dnanopb_common.h32 StatusWithSize EncodeRequest(ByteSpan buffer, in EncodeRequest()
36 StatusWithSize EncodeResponse(ByteSpan buffer, in EncodeResponse()
50 StatusWithSize Encode(NanopbMessageDescriptor fields,
/external/pigweed/pw_kvs/public/pw_kvs/internal/
Dentry.h100 StatusWithSize Write(Key key, std::span<const std::byte> value) const;
110 StatusWithSize Copy(Address new_address) const;
116 StatusWithSize ReadKey(std::array<char, kSize>& key) const { in ReadKey()
118 return StatusWithSize( in ReadKey()
122 StatusWithSize ReadValue(std::span<std::byte> buffer,

123