libscratchcpp
A library for C++ based Scratch project players
Toggle main menu visibility
Loading...
Searching...
No Matches
stringptr.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: Apache-2.0
2
3
#pragma once
4
5
#include "
global.h
"
6
7
namespace
libscratchcpp
8
{
9
10
extern
"C"
11
{
13
struct
LIBSCRATCHCPP_EXPORT
StringPtr
14
{
15
// NOTE: Constructors and destructors only work in C++ code and are not supposed to be used in LLVM IR
16
StringPtr
() =
default
;
17
StringPtr
(
const
std::string &str);
18
StringPtr
(
const
StringPtr
&) =
delete
;
19
20
~StringPtr
()
21
{
22
if
(
data
&&
allocatedSize
> 0)
23
free(
data
);
24
}
25
26
// NOTE: Any changes must also be done in the LLVM code builder!
27
char16_t
*
data
=
nullptr
;
28
size_t
size
= 0;
29
size_t
allocatedSize
= 0;
30
};
31
}
32
33
}
// namespace libscratchcpp
global.h
LIBSCRATCHCPP_EXPORT
#define LIBSCRATCHCPP_EXPORT
Definition
global.h:17
libscratchcpp
The main namespace of the library.
Definition
asset.h:10
libscratchcpp::StringPtr::StringPtr
StringPtr(const StringPtr &)=delete
libscratchcpp::StringPtr::data
char16_t * data
Definition
stringptr.h:27
libscratchcpp::StringPtr::StringPtr
StringPtr()=default
libscratchcpp::StringPtr::~StringPtr
~StringPtr()
Definition
stringptr.h:20
libscratchcpp::StringPtr::size
size_t size
Definition
stringptr.h:28
libscratchcpp::StringPtr::allocatedSize
size_t allocatedSize
Definition
stringptr.h:29
include
scratchcpp
stringptr.h
Generated by
1.17.0