MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / QGEdge_ToString

Function QGEdge_ToString

src/graph/entities/qg_edge.c:152–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void 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
178void QGEdge_Free
179(

Callers 2

EdgeIndexScanToStringFunction · 0.85
TraversalToStringFunction · 0.85

Calls 2

sdscatprintfFunction · 0.85
QGEdge_RelationCountFunction · 0.85

Tested by

no test coverage detected