Porytiles
Loading...
Searching...
No Matches
struct_variable_declaration.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
6
7namespace porytiles {
8
32 public:
41 : struct_type_{std::move(struct_type)}, variable_name_{std::move(variable_name)}, position_{position}
42 {
43 }
44
50 [[nodiscard]] const std::string &struct_type() const
51 {
52 return struct_type_;
53 }
54
60 [[nodiscard]] const std::string &variable_name() const
61 {
62 return variable_name_;
63 }
64
70 [[nodiscard]] const SourcePosition &position() const
71 {
72 return position_;
73 }
74
75 private:
76 std::string struct_type_;
77 std::string variable_name_;
78 SourcePosition position_;
79};
80
81} // namespace porytiles
Represents a parsed C struct variable declaration.
const std::string & struct_type() const
Returns the struct type name.
StructVariableDeclaration(std::string struct_type, std::string variable_name, SourcePosition position)
Constructs a StructVariableDeclaration.
const SourcePosition & position() const
Returns the source position of the variable name.
const std::string & variable_name() const
Returns the variable name.
Represents a position within source content.