forked from microsoft/onnxruntime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cxx_utils.h
32 lines (20 loc) · 900 Bytes
/
cxx_utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#import <Foundation/Foundation.h>
#include <optional>
#include <string>
#include <variant>
#import "cxx_api.h"
NS_ASSUME_NONNULL_BEGIN
@class ORTValue;
namespace utils {
NSString* toNSString(const std::string& str);
NSString* _Nullable toNullableNSString(const std::optional<std::string>& str);
std::string toStdString(NSString* str);
std::optional<std::string> toStdOptionalString(NSString* _Nullable str);
std::vector<std::string> toStdStringVector(NSArray<NSString*>* strs);
NSArray<NSString*>* toNSStringNSArray(const std::vector<std::string>& strs);
NSArray<ORTValue*>* _Nullable wrapUnownedCAPIOrtValues(const std::vector<OrtValue*>& values, NSError** error);
std::vector<const OrtValue*> getWrappedCAPIOrtValues(NSArray<ORTValue*>* values);
} // namespace utils
NS_ASSUME_NONNULL_END