Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/ |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 3 | * Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/ |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 4 | * |
| 5 | * Written by Václav Kubernát <kubervac@fit.cvut.cz> |
| 6 | * |
| 7 | */ |
| 8 | #include "ast.hpp" |
Václav Kubernát | b96eef7 | 2018-05-04 19:10:22 +0200 | [diff] [blame] | 9 | |
Václav Kubernát | b96eef7 | 2018-05-04 19:10:22 +0200 | [diff] [blame] | 10 | |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 11 | container_::container_(const std::string& name) |
| 12 | : m_name(name) |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 13 | { |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 14 | } |
| 15 | |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 16 | bool container_::operator==(const container_& b) const |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 17 | { |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 18 | return this->m_name == b.m_name; |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 19 | } |
| 20 | |
Václav Kubernát | 0720424 | 2018-06-04 18:12:09 +0200 | [diff] [blame^] | 21 | leaf_::leaf_(const std::string& name) |
| 22 | : m_name(name) |
| 23 | { |
| 24 | } |
| 25 | |
| 26 | bool leaf_::operator==(const leaf_& b) const |
| 27 | { |
| 28 | return this->m_name == b.m_name; |
| 29 | } |
| 30 | |
Václav Kubernát | b96eef7 | 2018-05-04 19:10:22 +0200 | [diff] [blame] | 31 | listElement_::listElement_(const std::string& listName, const std::map<std::string, std::string>& keys) |
Václav Kubernát | 0b76a04 | 2018-05-16 20:16:47 +0200 | [diff] [blame] | 32 | : m_name(listName) |
Václav Kubernát | b96eef7 | 2018-05-04 19:10:22 +0200 | [diff] [blame] | 33 | , m_keys(keys) |
| 34 | { |
| 35 | } |
| 36 | |
| 37 | bool listElement_::operator==(const listElement_& b) const |
| 38 | { |
Václav Kubernát | 0b76a04 | 2018-05-16 20:16:47 +0200 | [diff] [blame] | 39 | return (this->m_name == b.m_name && this->m_keys == b.m_keys); |
Václav Kubernát | b96eef7 | 2018-05-04 19:10:22 +0200 | [diff] [blame] | 40 | } |
| 41 | |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 42 | bool path_::operator==(const path_& b) const |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 43 | { |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 44 | if (this->m_nodes.size() != b.m_nodes.size()) |
| 45 | return false; |
| 46 | return this->m_nodes == b.m_nodes; |
| 47 | } |
Václav Kubernát | 8cd6342 | 2018-03-19 17:10:13 +0100 | [diff] [blame] | 48 | |
Václav Kubernát | 0720424 | 2018-06-04 18:12:09 +0200 | [diff] [blame^] | 49 | bool 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át | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 54 | bool cd_::operator==(const cd_& b) const |
| 55 | { |
| 56 | return this->m_path == b.m_path; |
| 57 | } |
Václav Kubernát | b61336d | 2018-05-28 17:35:03 +0200 | [diff] [blame] | 58 | |
| 59 | bool create_::operator==(const create_& b) const |
| 60 | { |
| 61 | return this->m_path == b.m_path; |
| 62 | } |
| 63 | |
| 64 | bool delete_::operator==(const delete_& b) const |
| 65 | { |
| 66 | return this->m_path == b.m_path; |
| 67 | } |