blob: 35bf1cb14509a6bddcfb521a29551865bde27829 [file] [log] [blame]
Václav Kubernát8cd63422018-03-19 17:10:13 +01001/*
2 * Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/
Václav Kubernátd6662962018-03-22 17:41:33 +01003 * Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/
Václav Kubernát8cd63422018-03-19 17:10:13 +01004 *
5 * Written by Václav Kubernát <kubervac@fit.cvut.cz>
6 *
7*/
8#include "ast.hpp"
Václav Kubernátb96eef72018-05-04 19:10:22 +02009
Václav Kubernátb96eef72018-05-04 19:10:22 +020010
Václav Kubernátd6662962018-03-22 17:41:33 +010011container_::container_(const std::string& name)
12 : m_name(name)
Václav Kubernát8cd63422018-03-19 17:10:13 +010013{
Václav Kubernát8cd63422018-03-19 17:10:13 +010014}
15
Václav Kubernátd6662962018-03-22 17:41:33 +010016bool container_::operator==(const container_& b) const
Václav Kubernát8cd63422018-03-19 17:10:13 +010017{
Václav Kubernátd6662962018-03-22 17:41:33 +010018 return this->m_name == b.m_name;
Václav Kubernát8cd63422018-03-19 17:10:13 +010019}
20
Václav Kubernát07204242018-06-04 18:12:09 +020021leaf_::leaf_(const std::string& name)
22 : m_name(name)
23{
24}
25
26bool leaf_::operator==(const leaf_& b) const
27{
28 return this->m_name == b.m_name;
29}
30
Václav Kubernátb96eef72018-05-04 19:10:22 +020031listElement_::listElement_(const std::string& listName, const std::map<std::string, std::string>& keys)
Václav Kubernát0b76a042018-05-16 20:16:47 +020032 : m_name(listName)
Václav Kubernátb96eef72018-05-04 19:10:22 +020033 , m_keys(keys)
34{
35}
36
37bool listElement_::operator==(const listElement_& b) const
38{
Václav Kubernát0b76a042018-05-16 20:16:47 +020039 return (this->m_name == b.m_name && this->m_keys == b.m_keys);
Václav Kubernátb96eef72018-05-04 19:10:22 +020040}
41
Václav Kubernátd6662962018-03-22 17:41:33 +010042bool path_::operator==(const path_& b) const
Václav Kubernát8cd63422018-03-19 17:10:13 +010043{
Václav Kubernátd6662962018-03-22 17:41:33 +010044 if (this->m_nodes.size() != b.m_nodes.size())
45 return false;
46 return this->m_nodes == b.m_nodes;
47}
Václav Kubernát8cd63422018-03-19 17:10:13 +010048
Václav Kubernát07204242018-06-04 18:12:09 +020049bool set_::operator==(const set_& b) const
50{
51 return this->m_path == b.m_path && this->m_data == b.m_data;
52}
53
Václav Kubernátd6662962018-03-22 17:41:33 +010054bool cd_::operator==(const cd_& b) const
55{
56 return this->m_path == b.m_path;
57}
Václav Kubernátb61336d2018-05-28 17:35:03 +020058
59bool create_::operator==(const create_& b) const
60{
61 return this->m_path == b.m_path;
62}
63
64bool delete_::operator==(const delete_& b) const
65{
66 return this->m_path == b.m_path;
67}