def tag_ref_str_size(node=None, parent=None, attr_index=None, rawdata=None,
    new_value=None, **kwargs):
    """Used to retrieve or set the byte size of a Halo tag
    reference string. If the string is empty, the actual amount
    of bytes it takes up is zero, otherwise it is (1+length) bytes.
    This is to account for the delimiter.

    When setting the size, the provided new_value is expected to
    be including the delimiter, so the reverse operation is applied.
    If the string's length is 1(only a delimiter), the bytes size
    is zero, but otherwise it is (length-1).

    Lengths of 1 cant exist."""
    if new_value is None:
        strlen = parent.path_length
        return strlen + bool(strlen)
    parent.path_length = (new_value - 1) * (new_value > 1)
