-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstant.cpp
45 lines (35 loc) · 1.57 KB
/
constant.cpp
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
//
// Created by Adam Dad on 23/08/2022.
//
#include "constant.h"
#include <utility>
Constant::Constant(unsigned char tag, const std::string &stringLiteral, uint16_t nameIndex, uint16_t stringIndex,
uint16_t classIndex, uint16_t nameAndTypeIndex, uint16_t descIndex) : tag(tag),
string_literal(stringLiteral),
name_index(nameIndex),
string_index(stringIndex),
class_index(classIndex),
name_and_type_index(
nameAndTypeIndex),
desc_index(descIndex) {}
const std::string &Constant::getStringLiteral() const {
return string_literal;
}
uint16_t Constant::getNameIndex() const {
return name_index;
}
uint16_t Constant::getStringIndex() const {
return string_index;
}
uint16_t Constant::getClassIndex() const {
return class_index;
}
uint16_t Constant::getNameAndTypeIndex() const {
return name_and_type_index;
}
uint16_t Constant::getDescIndex() const {
return desc_index;
}
unsigned char Constant::getTag() const {
return tag;
}