summaryrefslogtreecommitdiff
path: root/kms++/inc/kms++/property.h
blob: b9097ffc8f2fbb6a3db93c7d25404b0f23849a4b (plain)
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
#pragma once

#include "drmobject.h"
#include <map>
#include <vector>

namespace kms
{

struct PropertyPriv;

enum class PropertyType
{
	Range,
	Enum,
	Blob,
	Bitmask,
	Object,
	SignedRange,
};

class Property : public DrmObject
{
	friend class Card;
public:
	const std::string& name() const;

	bool is_immutable() const;
	bool is_pending() const;

	PropertyType type() const { return m_type; }
	std::map<uint64_t, std::string> get_enums() const;
	std::vector<uint64_t> get_values() const;
	std::vector<uint32_t> get_blob_ids() const;
private:
	Property(Card& card, uint32_t id);
	~Property();

	PropertyType m_type;

	PropertyPriv* m_priv;
	std::string m_name;
};
}