Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Path Contexts

Đang mở
#2 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
operating-systems

Hướng nghiên cứu

Không có tệp hoặc bài kiểm thử nào được nêu tên. Hãy bắt đầu bằng cách xác định các *Path types và LocalPath hiện có, sau đó lần theo các constructor và thao tác xử lý đường dẫn của chúng. Công việc được xem là hoàn tất khi các kiểu đó dùng chung một API ngữ cảnh đường dẫn hỗ trợ dấu phân cách, hành vi theo nền tảng, việc xác thực, các ngữ cảnh constructor tùy chỉnh và hành vi mặc định của LocalPathContext.Instance được mô tả trong TODO.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement help wanted

We'll need a file system API for virtual paths. Local path (#1) should implement the same API, so it should be possible to abstract over both kinds of paths.

The API should allow to:

  • manipulate foreign paths, e.g. Windows paths on a Linux computer, and vice versa;
  • introduce fully virtual file systems.

Currently, I am thinking of adding a new field of type IFileSystem or IPathContext to each of our path types: hopefully, this won't create too much overhead for their storage.

Default constructors would rely on a singleton instance for the current system, something like new LocalPath("foo") => new LocalPath("foo", LocalFileSystem.Instance).

There should be a way for the user to introduce custom path validation in constructor. For example, if they want to somehow avoid Windows paths on Linux and want to throw on new LocalPath(CustomContext, @"C:\Windows"), even though this path is valid.

TODO

  • Introduce a field into all *Path types.
  • Derive the path manipulation operations to the path context:
    • path separators,
    • behavior aspects such as Windows drives,
    • path validation in constructors (even for LocalPath that doesn't do any validation otherwise).
  • Allow passing the context to path constructors.
  • The constructors should delegate to some LocalPathContext.Instance by default (if nothing else is passed).
  • LocalPathContext.Instance should be a writable field (for global custom override).
  • Future enhancement request: allow ThreadLocal and/or AsyncLocal override for LocalPathContext, to avoid reliance on the global state.
Ngôn ngữ chính
C#
Star
104
Fork
19
Merge trung bình
13 giờ 42 phút
Pull request đã merge (30 ngày)
9

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ForNeVeR/TruePath

Tất cả issue của ForNeVeR/TruePath

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.