class FieldProjectionMapPrinter(object):
|
"""Pretty-printer for FieldProjectionMap."""
|
def __init__(self, val):
|
"""Initialize FieldProjectionMapPrinter."""
|
self.val = val
|
@staticmethod
|
def display_hint():
|
"""Display hint."""
|
return None
|
def to_string(self):
|
rid_proj = self.val["_ridProjection"]
|
root_proj = self.val["_rootProjection"]
|
res = "{"
|
if get_boost_optional(rid_proj) is not None:
|
res += "<rid>: " + str(rid_proj) + ", "
|
if get_boost_optional(root_proj) is not None:
|
res += "<root>: " + str(root_proj) + ", "
|
# Rely on default printer for std::set, but remove the extra metadata at the start.
|
field_projections = self.val["_fieldProjections"]
|
res += "<empty>" if field_projections["size_"] == 0 else str(field_projections).split(
|
"elems =")[-1]
|
res += "}"
|
return res
|