reference
labkit.app.diagnostic.SampleContext
Provide bounded folders for anonymous debug samples.
Syntax
context = labkit.app.diagnostic.SampleContext(artifactFolder)
filepath = context.samplePath(relativePath)
filepath = context.outputPath(relativePath)
record = context.sourceRecord(id,role,filepath,required)
artifact = context.artifact(id,role,filepath,Name=Value)Description
SampleContext creates one diagnostic root with samples and outputs children. App-owned BuildDebugSample callbacks may write only anonymous synthetic files beneath these folders. The value does not expose a runtime, recorder, project store, or UI object.
Inputs
artifactFolder- Nonempty scalar diagnostic-session folder.
relativePath- Nonempty child path without an absolute root, empty segment, current segment, or parent traversal.
id- Stable portable-source identifier.
role- Stable portable-source role.
filepath- Path returned by samplePath.
required- Logical scalar source requirement.
Outputs
context- Immutable diagnostic sample context.
filepath- Absolute path bounded by SampleFolder or OutputFolder.
record- Portable source value from
labkit.app.project.sourceRecord. artifact- Typed diagnostic artifact whose relative path is derived from a filepath beneath ArtifactFolder.
Errors
labkit:app:contract:InvalidValue- A folder, relative path, or source argument is malformed. MATLAB filesystem errors propagate when the diagnostic folders cannot be created.
Typical Call
context = labkit.app.diagnostic.SampleContext(tempname);
filepath = context.samplePath("input.csv");Related APIs
labkit.app.diagnostic.Artifact— Describe one anonymous diagnostic-sample artifact.labkit.app.diagnostic.SamplePack— Describe one typed anonymous App reproduction scenario.labkit.app.project.sourceRecord— Create a portable source value during project migration.labkit.app.diagnostic.Options— Configure one App SDK diagnostic session.
Source
This page is generated from the MATLAB help text in +labkit/+app/+diagnostic/SampleContext.m.