| 94 | } |
| 95 | |
| 96 | std::string SourceSelection::ToString(bool resolve) const |
| 97 | { |
| 98 | switch (_type) { |
| 99 | case Type::SOURCE: |
| 100 | return GetWeakSourceName(_source); |
| 101 | case Type::VARIABLE: { |
| 102 | auto var = _variable.lock(); |
| 103 | if (!var) { |
| 104 | return ""; |
| 105 | } |
| 106 | if (resolve) { |
| 107 | return var->Name() + "[" + var->Value() + "]"; |
| 108 | } |
| 109 | return var->Name(); |
| 110 | } |
| 111 | default: |
| 112 | break; |
| 113 | } |
| 114 | return ""; |
| 115 | } |
| 116 | |
| 117 | bool SourceSelection::operator==(const SourceSelection &other) const |
| 118 | { |
no test coverage detected