-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathasset.h
More file actions
47 lines (32 loc) · 1.08 KB
/
Copy pathasset.h
File metadata and controls
47 lines (32 loc) · 1.08 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "entity.h"
#include "spimpl.h"
#include "global.h"
namespace libscratchcpp
{
class Target;
class AssetPrivate;
/*! \brief The Asset class represents a Scratch asset, for example a Costume or a Sound. */
class LIBSCRATCHCPP_EXPORT Asset : public Entity
{
public:
Asset(const std::string &name, const std::string &id, const std::string &format);
Asset(const Asset &) = delete;
virtual ~Asset();
void setId(const std::string &id);
const std::string &name() const;
const std::string &fileName() const;
const std::string &dataFormat() const;
const void *data() const;
unsigned int dataSize() const;
void setData(unsigned int size, void *data);
Target *target() const;
void setTarget(Target *target);
protected:
virtual void processData(unsigned int size, void *data) { }
virtual bool isClone() const { return false; }
private:
spimpl::unique_impl_ptr<AssetPrivate> impl;
};
} // namespace libscratchcpp