Sphyrnidae Common Library  2.0.1
Shared Utilities/Library
Sphyrnidae.Common.Paths.RelativePathBuilder Class Reference

Parses out relative paths More...

Public Member Functions

 RelativePathBuilder (string path="")
 Constructor More...
 
RelativePathBuilder ClearPathSegments ()
 If you wish to remove all path segments to build new ones (existing segments can be retrieved via public property) More...
 
RelativePathBuilder RemoveFirstSegment ()
 Removes the first path segment More...
 
RelativePathBuilder RemoveLastSegment ()
 Removes the last path segment More...
 
RelativePathBuilder AddPathSegment (string segment)
 Adds a segment to the relative path More...
 
RelativePathBuilder AddPathSegmentToBeginning (string segment)
 Adds a segment to the beginning of the relative path More...
 
RelativePathBuilder ClearQueryString ()
 Removes all items from the query string More...
 
RelativePathBuilder RemoveFromQueryString (string key)
 Removes an item from the query string. If key not found, this does nothing More...
 
RelativePathBuilder AddQueryString (string key, string value)
 Adds a key and value combination to the query string (parameters are raw text, the actual relative path will have these properly escaped) More...
 
RelativePathBuilder WithFragment (string fragment)
 Sets the fragment for the relative path More...
 
string Build ()
 Must be called last More...
 

Detailed Description

Parses out relative paths

Constructor & Destructor Documentation

◆ RelativePathBuilder()

Sphyrnidae.Common.Paths.RelativePathBuilder.RelativePathBuilder ( string  path = "")

Constructor

Parameters
pathThe existing relative path (if not provided, will start with empty string)

Member Function Documentation

◆ AddPathSegment()

RelativePathBuilder Sphyrnidae.Common.Paths.RelativePathBuilder.AddPathSegment ( string  segment)

Adds a segment to the relative path

Parameters
segmentThe segment to add
Returns
The RelativePathBuilder so you can chain/build

◆ AddPathSegmentToBeginning()

RelativePathBuilder Sphyrnidae.Common.Paths.RelativePathBuilder.AddPathSegmentToBeginning ( string  segment)

Adds a segment to the beginning of the relative path

Parameters
segmentThe segment to add
Returns
The RelativePathBuilder so you can chain/build

◆ AddQueryString()

RelativePathBuilder Sphyrnidae.Common.Paths.RelativePathBuilder.AddQueryString ( string  key,
string  value 
)

Adds a key and value combination to the query string (parameters are raw text, the actual relative path will have these properly escaped)

Parameters
keyThe key (eg. key=value)
valueThe value (eg. key=value)
Returns
The RelativePathBuilder so you can chain/build

◆ Build()

string Sphyrnidae.Common.Paths.RelativePathBuilder.Build ( )

Must be called last

Returns
The fully built relative path you pieced together using the RelativePathBuilder class

◆ ClearPathSegments()

RelativePathBuilder Sphyrnidae.Common.Paths.RelativePathBuilder.ClearPathSegments ( )

If you wish to remove all path segments to build new ones (existing segments can be retrieved via public property)

Returns
The RelativePathBuilder so you can chain/build

◆ ClearQueryString()

RelativePathBuilder Sphyrnidae.Common.Paths.RelativePathBuilder.ClearQueryString ( )

Removes all items from the query string

Returns
The RelativePathBuilder so you can chain/build

◆ RemoveFirstSegment()

RelativePathBuilder Sphyrnidae.Common.Paths.RelativePathBuilder.RemoveFirstSegment ( )

Removes the first path segment

Returns
The RelativePathBuilder so you can chain/build

◆ RemoveFromQueryString()

RelativePathBuilder Sphyrnidae.Common.Paths.RelativePathBuilder.RemoveFromQueryString ( string  key)

Removes an item from the query string. If key not found, this does nothing

Parameters
keyThe key (eg. key=value)
Returns
The RelativePathBuilder so you can chain/build

◆ RemoveLastSegment()

RelativePathBuilder Sphyrnidae.Common.Paths.RelativePathBuilder.RemoveLastSegment ( )

Removes the last path segment

Returns
The RelativePathBuilder so you can chain/build

◆ WithFragment()

RelativePathBuilder Sphyrnidae.Common.Paths.RelativePathBuilder.WithFragment ( string  fragment)

Sets the fragment for the relative path

Parameters
fragmentThe fragment to use
Returns
The RelativePathBuilder so you can chain/build

The documentation for this class was generated from the following file: