PathToUrlMapper Class
- Namespace
- Kampute.DocToolkit.Routing
- Assembly
- Kampute.DocToolkit.dll
Definition
Provides a mapping between file references and their corresponding URLs.
public class PathToUrlMapper : IUrlTransformer, IReadOnlyCollection<KeyValuePair<string, Uri>>- Inheritance
- object
- PathToUrlMapper
- Implements
Remarks
Thread Safety
Public static members of the type are guaranteed to be thread-safe. However, public instance members are not thread-safe.
Constructors
| PathToUrlMapper() | Initializes a new instance of the PathToUrlMapper class. |
Properties
| Count | Gets the number of URL mappings. |
| MayTransformUrls | Gets a value indicating whether the URL mapper has any mappings. |
Methods
| Add(string, Uri) | Adds a URL mapping for the specified source path. |
| Clear() | Clears all URL mappings. |
| Contains(string) | Determines whether the specified path has a URL mapping. |
| GetEnumerator() | Returns an enumerator that iterates through the collection of URL mappings. |
| Remove(string) | Removes a URL mapping for the specified source path. |
| TryTransformUrl(string, out Uri) | Attempts to transform a URL string to its corresponding replacement URL. |
Explicit Interface Implementations
| IEnumerable.GetEnumerator() | Returns an enumerator that iterates through the collection. |

This implementation uses case-insensitive key matching and supports partial URL matching, allowing it to handle URLs with query parameters and fragments. The class can be used directly for managing URL mappings or as a component in a larger documentation generation pipeline.