| 150 | } |
| 151 | |
| 152 | void QGEdge_ToString |
| 153 | ( |
| 154 | const QGEdge *e, |
| 155 | sds *buff |
| 156 | ) { |
| 157 | ASSERT(e && buff && *buff); |
| 158 | |
| 159 | *buff = sdscatprintf(*buff, "["); |
| 160 | |
| 161 | if(e->alias) *buff = sdscatprintf(*buff, "%s", e->alias); |
| 162 | uint reltype_count = QGEdge_RelationCount(e); |
| 163 | for(uint i = 0; i < reltype_count; i ++) { |
| 164 | // Multiple relationship types are printed separated by pipe characters |
| 165 | if(i > 0) *buff = sdscatprintf(*buff, "|"); |
| 166 | *buff = sdscatprintf(*buff, ":%s", e->reltypes[i]); |
| 167 | } |
| 168 | if(e->minHops != 1 || e->maxHops != 1) { |
| 169 | if(e->maxHops == EDGE_LENGTH_INF) |
| 170 | *buff = sdscatprintf(*buff, "*%u..INF", e->minHops); |
| 171 | else |
| 172 | *buff = sdscatprintf(*buff, "*%u..%u", e->minHops, e->maxHops); |
| 173 | } |
| 174 | |
| 175 | *buff = sdscatprintf(*buff, "]"); |
| 176 | } |
| 177 | |
| 178 | void QGEdge_Free |
| 179 | ( |
no test coverage detected