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
30 public:
37 : struct_type_{std::move(struct_type)}, variable_name_{std::move(variable_name)}, position_{position}
38 {
39 }
40
44 [[nodiscard]] const std::string &struct_type() const
45 {
46 return struct_type_;
47 }
48
52 [[nodiscard]] const std::string &variable_name() const
53 {
54 return variable_name_;
55 }
56
60 [[nodiscard]] const SourcePosition &position() const
61 {
62 return position_;
63 }
64
65 private:
66 std::string struct_type_;
67 std::string variable_name_;
68 SourcePosition position_;
69};
70
71} // 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.