Updating Xamarin/Microsoft file headers
[platform/upstream/libSkiaSharp.git] / src / c / sk_string.cpp
1 /*
2  * Copyright 2014 Google Inc.
3  * Copyright 2015 Xamarin Inc.
4  * Copyright 2017 Microsoft Corporation. All rights reserved.
5  *
6  * Use of this source code is governed by a BSD-style license that can be
7  * found in the LICENSE file.
8  */
9
10 #include "SkString.h"
11
12 #include "sk_string.h"
13
14 #include "sk_types_priv.h"
15
16 sk_string_t* sk_string_new_empty() {
17     return ToString(new SkString());
18 }
19
20 sk_string_t* sk_string_new_with_copy(const char* src, size_t length) {
21     return ToString(new SkString(src, length));
22 }
23
24 void sk_string_destructor(const sk_string_t* cstring) {
25     delete AsString(cstring);
26 }
27
28 size_t sk_string_get_size(const sk_string_t* cstring) {
29     return AsString(cstring)->size();
30 }
31
32 const char* sk_string_get_c_str(const sk_string_t* cstring) {
33     return AsString(cstring)->c_str();
34 }