Skip to content

Fast native file system path abstraction #1

@ForNeVeR

Description

@ForNeVeR

So, we need an abstraction over a file system path which:

  • is able to parse a file system path on the local file system
  • guarantees that the path is absolute (or relative, or either)
  • is either a struct or a value object (immutable)
  • is normalized (i.e. no double or trailing separators, automatic stripping of UNC prefix on Windows)
  • provides a set of operators to append either a string or a relative path
  • should be fast (i.e. the virtual methods are unwanted, if it's possible to live without them)
  • provides a set of basic operations:
    • canonicalize,
    • concatenate,
    • check if a file or a directory,
    • convert to a string.

Open questions:

  • interning? (may be useful for normalized paths)
    • decided for now out of scope
  • definition of canonicalization? (to me, it's obvious we should convert paths to the right case on case-insensitive file systems, but file systems may behave their own way)
    • this is called normalization and now documented

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions