Class PathUtils
Namespace: UnityEngine.Perception.GroundTruth.Consumers
Syntax
public static class PathUtils : object
Methods
CombineUniversal(String[])
Combines paths together. This method always uses the alternative directory spacer, '/' on windows, mac, and linux machines so that paths writtent to json are consistent.
Declaration
public static string CombineUniversal(params string[] paths)
Parameters
| Type | Name | Description |
|---|---|---|
| String[] | paths | An arbitrary length array of paths to combine together. |
Returns
| Type | Description |
|---|---|
| String | The combined path |
EnsurePathsAreUniversal(String)
Replaces windows slashes "" with universal paths "/"
Declaration
public static string EnsurePathsAreUniversal(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | The path to update |
Returns
| Type | Description |
|---|---|
| String | The cleaned up path |
WriteAndReportImageFile(String, Byte[])
Writes image out to a file and registers the file with the simulation manager.
Declaration
public static void WriteAndReportImageFile(string path, byte[] bytes)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | The path to write to. |
| Byte[] | bytes | The image bytes. |
WriteAndReportJsonFile(String, JToken)
Writes json out to a file and registers the file with the simulation manager.
Declaration
public static void WriteAndReportJsonFile(string filePath, JToken json)
Parameters
| Type | Name | Description |
|---|---|---|
| String | filePath | The path to write to. |
| JToken | json | The json information to write out. |