IReadOnlyTopicCollection.TryFindBySubpath Method
- Namespace
- Kampute.DocToolkit.Collections
- Assembly
- Kampute.DocToolkit.dll
Definition
Attempts to find a file-backed topic in the topic hierarchy by its subpaths.
bool TryFindBySubpath(string filePath, [NotNullWhen(true)] out TopicModel topic)Parameters
filePathstring- The file path or subpath of the topic to lookup.
topicTopicModel- When this method returns, contains the topic that uniquely matches the specified file path or subpath; otherwise,
nullif no match or if ambiguous.

filePath. If multiple topics match, the match is considered ambiguous and the method returnsfalse.Matching is case-insensitive and directory separators can be either slash ('/') or backslash ('\'). The search is performed in linear time O(n) relative to the number of file-backed topics.