libscratchcpp
A library for C++ based Scratch project players
Toggle main menu visibility
Loading...
Searching...
No Matches
field.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: Apache-2.0
2
3
#pragma once
4
5
#include <string>
6
#include <memory>
7
8
#include "
global.h
"
9
#include "spimpl.h"
10
11
namespace
libscratchcpp
12
{
13
14
class
Entity
;
15
class
Value
;
16
class
FieldPrivate;
17
19
class
LIBSCRATCHCPP_EXPORT
Field
20
{
21
public
:
22
Field
(
const
std::string &
name
,
const
Value
&
value
, std::shared_ptr<Entity>
valuePtr
=
nullptr
);
23
Field
(
const
std::string &
name
,
const
Value
&
value
,
const
std::string &
valueId
);
24
Field
(
const
std::string &
name
,
const
Value
&
value
,
const
char
*
valueId
);
25
Field
(
const
Field
&) =
delete
;
26
27
const
std::string &
name
()
const
;
28
29
const
Value
&
value
()
const
;
30
31
std::shared_ptr<Entity>
valuePtr
()
const
;
32
void
setValuePtr
(
const
std::shared_ptr<Entity> &newValuePtr);
33
34
const
std::string &
valueId
()
const
;
35
36
private
:
37
spimpl::unique_impl_ptr<FieldPrivate> impl;
38
};
39
40
}
// namespace libscratchcpp
libscratchcpp::Entity
The Entity class is the base class of everything that is identified by an ID (Target,...
Definition
entity.h:17
libscratchcpp::Field::name
const std::string & name() const
Definition
field.cpp:29
libscratchcpp::Field::value
const Value & value() const
Definition
field.cpp:35
libscratchcpp::Field::Field
Field(const std::string &name, const Value &value, std::shared_ptr< Entity > valuePtr=nullptr)
Definition
field.cpp:11
libscratchcpp::Field::valuePtr
std::shared_ptr< Entity > valuePtr() const
Definition
field.cpp:41
libscratchcpp::Field::valueId
const std::string & valueId() const
Definition
field.cpp:58
libscratchcpp::Field::setValuePtr
void setValuePtr(const std::shared_ptr< Entity > &newValuePtr)
Definition
field.cpp:47
libscratchcpp::Field::Field
Field(const Field &)=delete
libscratchcpp::Value
The Value class represents a Scratch value.
Definition
value.h:22
global.h
LIBSCRATCHCPP_EXPORT
#define LIBSCRATCHCPP_EXPORT
Definition
global.h:17
libscratchcpp
The main namespace of the library.
Definition
asset.h:10
include
scratchcpp
field.h
Generated by
1.17.0