Skip to content
Snippets Groups Projects
Commit b131429b authored by paulavidas's avatar paulavidas Committed by Copybara-Service
Browse files

Change return type of Write from Status to StatusOr<int>.

PiperOrigin-RevId: 266746557
parent 648222d2
No related branches found
No related tags found
No related merge requests found
......@@ -18,8 +18,10 @@ cc_library(
cc_library(
name = "simple_output_stream",
hdrs = ["simple_output_stream.h"],
include_prefix = "tink/",
deps = [
"//cc/util:status",
"//cc/util:statusor",
"@com_google_absl//absl/strings",
],
)
......@@ -10,13 +10,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from "tink/python/util/clif.h" import * # Status
from "tink/python/util/clif.h" import * # Status, StatusOr
from "tink/python/cc/simple_output_stream.h":
namespace `crypto::tink`:
class SimpleOutputStream:
@virtual
def `Write` as write(self, data: bytes) -> Status
def `Write` as write(self, data: bytes) -> StatusOr<int>
@virtual
def `Close` as close(self) -> Status
......
......@@ -17,6 +17,7 @@
#include "absl/strings/string_view.h"
#include "tink/util/status.h"
#include "tink/util/statusor.h"
namespace crypto {
namespace tink {
......@@ -25,8 +26,9 @@ namespace tink {
// from Python to C++ via CLIF and vice versa.
class SimpleOutputStream {
public:
// Writes 'data' to the underlying stream.
virtual util::Status Write(absl::string_view data) = 0;
// Writes 'data' to the underlying stream and returns the number of bytes
// written, which can be less than the size of 'data'.
virtual util::StatusOr<int> Write(absl::string_view data) = 0;
// Closes the underlying stream.
virtual util::Status Close() = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment