Skip to content

Implement ElementType.kCharStar #20

Description

@nsmith-

This type is used in the StreamerInfo for the TString class, which suggests its implementation.
Here I'm printing out the TString streamer from uproot-sample-5.25.02-uncompressed.root:

TStreamerInfo(
    fVersion=1,
    fUniqueID=0,
    fBits=50331648,
    pidf=None,
    fName=TString(fString=b"TString"),
    fTitle=TString(fString=b""),
    fCheckSum=1332649469,
    fClassVersion=1,
    fObjects=TObjArray(
        fVersion=1,
        fUniqueID=0,
        fBits=50331648,
        pidf=None,
        fName=TString(fString=b""),
        fSize=1,
        fLowerBound=0,
        objects=(
            TStreamerBasicType(
                fVersion=1,
                fUniqueID=0,
                fBits=50331648,
                pidf=None,
                fName=TString(fString=b"fData"),
                fTitle=TString(fString=b"ref. counted data (TStringRef is in front)"),
                fType=ElementType.kCharStar,
                fSize=8,
                fArrayLength=0,
                fArrayDim=0,
                fMaxIndex=ArrayDim(dim0=0, dim1=0, dim2=0, dim3=0, dim4=0),
                fTypeName=TString(fString=b"char*"),
            ),
        ),
    ),
)


@serializable
class TString(StreamedObject):
    fData: Annotated[bytes, Fmt("charstar")]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions