1/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#include "tensorflow/c/tf_tstring.h"
17
18#include "tensorflow/core/platform/ctstring_internal.h"
19
20void TF_StringInit(TF_TString *tstr) { TF_TString_Init(tstr); }
21
22void TF_StringCopy(TF_TString *dst, const char *src, size_t size) {
23 TF_TString_Copy(dst, src, size);
24}
25
26void TF_StringAssignView(TF_TString *dst, const char *src, size_t size) {
27 TF_TString_AssignView(dst, src, size);
28}
29
30const char *TF_StringGetDataPointer(const TF_TString *tstr) {
31 return TF_TString_GetDataPointer(tstr);
32}
33
34TF_TString_Type TF_StringGetType(const TF_TString *str) {
35 return TF_TString_GetType(str);
36}
37
38size_t TF_StringGetSize(const TF_TString *tstr) {
39 return TF_TString_GetSize(tstr);
40}
41
42size_t TF_StringGetCapacity(const TF_TString *str) {
43 return TF_TString_GetCapacity(str);
44}
45
46void TF_StringDealloc(TF_TString *tstr) { TF_TString_Dealloc(tstr); }
47