• APIブラウザ
  • 設計思想
Show / Hide Table of Contents
  • ExapisSOP
    • AppWorker
    • ContextEventArgs
    • HostRunner
    • IConfiguration
    • IContext
    • IPipeline
    • IProcess
    • IProcess<TParam, TResult>
    • IService
    • TerminationEventArgs
    • TerminationException
    • TerminationReason
    • UnhandledErrorEventArgs
    • VersionInfo
  • ExapisSOP.Binary
    • DataValue
  • ExapisSOP.Core
    • ConfigurationExtensions
    • ContextExtensions
    • CustomPipelineProcess<TParam, TResult>
    • ImmutablePipeline
    • Pipeline
    • PipelineExtensions
    • PipelineExtensions.ExceptionHandler
    • PipelineExtensions.ExceptionHandler<TParam, TResult>
    • PipelineExtensions.LoggingProcess
    • PipelineExtensions.NextProcessFunc
    • PipelineExtensions.ProcessFunc
    • PipelineExtensions.ProcessFunc<TParam, TResult>
    • PipelineExtensions.ProcessFuncWrapper
    • PipelineExtensions.ProcessFuncWrapper<TParam, TResult>
  • ExapisSOP.Globalization
    • EnglishErrorReportBuilder
    • JapaneseErrorReportBuilder
  • ExapisSOP.IO
    • CachedStream
    • DefaultPath
    • FileSystemServiceOptions
    • FileSystemServiceOptionsExtensions
    • IFileSystemService
    • InvalidPathFormatException
    • IPathList
    • Paths
    • PathString
    • PathStringFormatter
  • ExapisSOP.IO.Logging
    • ConsoleLogger
    • DefaultErrorDetailProvider
    • ErrorReportBuilder
    • ExceptionRecord
    • HResultDetailProvider
    • ICustomErrorDetailProvider
    • ILogFile
    • ILoggable
    • ILogger
    • ILoggingSystemService
    • LogData
    • LogFile
    • LogFileType
    • Logger
    • LoggerExtension
    • LoggingSystemServiceOptions
    • LoggingSystemServiceOptions.CreateLogFile
    • LogLevel
    • LongMessageRecord
    • MultipleLogger
    • OutputStreamLogger
  • ExapisSOP.IO.Settings
    • CustomSettings
    • DataStore
    • DefaultSettings
    • EnvironmentSettings
    • ISettingsSystemService
    • OptimizedSettings
    • SettingsSystemServiceOptions
    • SettingsSystemServiceOptions.ConfirmVersionInfo
    • SettingsSystemServiceOptions.GetVersionInfo
  • ExapisSOP.IO.Settings.CommandLine
    • CommandLineConverter
    • CommandLineParser
    • CommandLineServiceOptions
    • CommandLineServiceOptions.CreateConverterMappingTable
    • FileNameList
    • IArgumentConverter
    • IArgumentConverter<T>
    • ICommandLineService
    • ManualAttribute
    • Option
    • Option.Value
    • OptionAttribute
    • Switch
    • SwitchAttribute
  • ExapisSOP.NativeWrapper
    • INativeCaller
    • WinAPI
  • ExapisSOP.NativeWrapper.Windows
    • Kernel32
  • ExapisSOP.Numerics
    • CryptionRandom
    • IRandom
    • LinearCongruentialGenerator
    • RandomExtension
    • SerializableRandom
    • SystemRandom
    • Xorshift
    • Xorshift2
  • ExapisSOP.Text
    • SimpleEncoding
    • SimpleString
  • ExapisSOP.Utils
    • ArrayExtensions
    • ConsoleUtil
    • DisposableBase
    • IAwaitable<T>
    • IAwaiter<T>
    • IUtilityService
    • SecureStringExtensions
    • SerializationInfoExtensions
    • StringExtensions
    • StringUtil
    • UtilityConfigurationExtensions
    • UtilityContextExtensions

PathString クラス

パス文字列を表します。 このクラスは継承できません。

継承
System.Object
PathString
実装
System.IFormattable
System.IEquatable<PathString>
System.IEquatable<System.String>
System.IComparable
System.IComparable<PathString>
System.IComparable<System.String>
継承されたメンバー
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
名前空間: ExapisSOP.IO
アセンブリ: ExapisSOP.dll
構文
[TypeConverter(typeof(PathStringConverter))]
public sealed class PathString : IFormattable, IEquatable<PathString>, IEquatable<string>, IComparable, IComparable<PathString>, IComparable<string>
脚注

System.IO.Pathクラスと併用してください。

コンストラクタ 一覧

| 編集/提案 ソースを表示

PathString()

型'PathString'の新しいインスタンスを生成します。

宣言
public PathString()
| 編集/提案 ソースを表示

PathString(String)

型'PathString'の新しいインスタンスを生成します。

宣言
public PathString(string path)
引数
型 名前 説明
System.String path

新しいインスタンスに設定するパス文字列です。 相対パスの場合、絶対パスへ自動的に変換されます。

例外
型 条件
System.ArgumentNullException

pathがnullに設定されています。

InvalidPathFormatException

無効なパス文字列が渡されました。

System.Security.SecurityException

プロパティ 一覧

| 編集/提案 ソースを表示

BasePath

基底のパス文字列を取得します。

宣言
public PathString BasePath { get; }
プロパティ値
型 説明
PathString
脚注

GetDirectoryName()と全く同じ動作を行います。

| 編集/提案 ソースを表示

Exists

現在のパス文字列が実際に存在する場合はtrue、それ以外の場合はfalseを返します。

宣言
public bool Exists { get; }
プロパティ値
型 説明
System.Boolean
| 編集/提案 ソースを表示

IsDirectory

現在のパス文字列が実際に存在し、ディレクトリである場合はtrueを返します。 それ以外の場合はfalseを返します。

宣言
public bool IsDirectory { get; }
プロパティ値
型 説明
System.Boolean
| 編集/提案 ソースを表示

IsDrive

現在のパス文字列が実際に存在し、ドライブである場合はtrueを返します。 それ以外の場合はfalseを返します。

宣言
public bool IsDrive { get; }
プロパティ値
型 説明
System.Boolean
| 編集/提案 ソースを表示

IsFile

現在のパス文字列が実際に存在し、ファイルである場合はtrueを返します。 それ以外の場合はfalseを返します。

宣言
public bool IsFile { get; }
プロパティ値
型 説明
System.Boolean
| 編集/提案 ソースを表示

IsRoot

現在のパス文字列がルートディレクトリを表しているかどうかを判定します。

宣言
public bool IsRoot { get; }
プロパティ値
型 説明
System.Boolean

メソッド 一覧

| 編集/提案 ソースを表示

AsUri()

パス文字列をURIへ変換します。

宣言
public Uri AsUri()
戻り値
型 説明
System.Uri

System.Uri形式のオブジェクトです。

| 編集/提案 ソースを表示

ChangeExtension(String)

パス文字列の拡張子を変更します。

宣言
public PathString ChangeExtension(string extension)
引数
型 名前 説明
System.String extension

変更後の拡張子、または、拡張子を削除する場合は空値を指定してください。

戻り値
型 説明
PathString

拡張子が変更されたパス文字列、または、 拡張子が変更されなかった場合は現在のインスタンスを返します。

例外
型 条件
InvalidPathFormatException

無効なパス文字列が渡されました。

System.ArgumentException
System.Security.SecurityException
| 編集/提案 ソースを表示

ChangeFileName(String)

パス文字列の拡張子を含むファイル名を変更します。

宣言
public PathString ChangeFileName(string filename)
引数
型 名前 説明
System.String filename

変更後の拡張子を含むファイル名、または、親ディレクトリを取得する場合は空値を指定してください。

戻り値
型 説明
PathString

ファイル名が変更されたパス文字列、または、 ファイル名が変更されなかった場合は現在のインスタンスを返します。 親ディレクトリの情報が存在しない場合はnullを返します。

例外
型 条件
InvalidPathFormatException

無効なパス文字列が渡されました。

System.Security.SecurityException
| 編集/提案 ソースを表示

Combine(String)

指定されたパスを現在のパスと結合します。

宣言
public PathString Combine(string path)
引数
型 名前 説明
System.String path

結合するパス文字列です。

戻り値
型 説明
PathString

結合された新しいパス文字列、または、pathが空の場合は現在のインスタンスを返します。

例外
型 条件
InvalidPathFormatException

無効なパス文字列が渡されました。

System.Security.SecurityException
| 編集/提案 ソースを表示

Combine(String, String)

指定された2つのパスを現在のパスと結合します。

宣言
public PathString Combine(string path1, string path2)
引数
型 名前 説明
System.String path1

結合する1つ目のパス文字列です。

System.String path2

結合する2つ目のパス文字列です。

戻り値
型 説明
PathString

結合された新しいパス文字列、または、指定された全てのパスが空の場合は現在のインスタンスを返します。

例外
型 条件
InvalidPathFormatException

無効なパス文字列が渡されました。

System.Security.SecurityException
| 編集/提案 ソースを表示

Combine(String, String, String)

指定された3つのパスを現在のパスと結合します。

宣言
public PathString Combine(string path1, string path2, string path3)
引数
型 名前 説明
System.String path1

結合する1つ目のパス文字列です。

System.String path2

結合する2つ目のパス文字列です。

System.String path3

結合する3つ目のパス文字列です。

戻り値
型 説明
PathString

結合された新しいパス文字列、または、指定された全てのパスが空の場合は現在のインスタンスを返します。

例外
型 条件
InvalidPathFormatException

無効なパス文字列が渡されました。

System.Security.SecurityException
| 編集/提案 ソースを表示

Combine(String[])

複数のパスを一つのパスに結合します。

宣言
public PathString Combine(params string[] paths)
引数
型 名前 説明
System.String[] paths

結合する複数のパス文字列です。

戻り値
型 説明
PathString

結合された新しいパス文字列、または、pathsが空の場合は現在のインスタンスを返します。

例外
型 条件
InvalidPathFormatException

無効なパス文字列が渡されました。

System.Security.SecurityException
| 編集/提案 ソースを表示

CompareTo(PathString)

指定したパス文字列と現在のパス文字列を比較します。

宣言
public int CompareTo(PathString other)
引数
型 名前 説明
PathString other

比較対象のパス文字列です。

戻り値
型 説明
System.Int32

等価の場合は

0
、 現在のインスタンスの方が大きい場合は正の値、 現在のインスタンスの方が小さい場合は負の値を返します。

| 編集/提案 ソースを表示

CompareTo(Object)

指定したオブジェクトインスタンスの値と現在のインスタンスの値を比較します。

宣言
public int CompareTo(object obj)
引数
型 名前 説明
System.Object obj

比較対象のオブジェクトです。

戻り値
型 説明
System.Int32

等価の場合は

0
、 現在のインスタンスの方が大きい場合は正の値、 現在のインスタンスの方が小さい場合は負の値を返します。

| 編集/提案 ソースを表示

CompareTo(String)

指定した文字列と現在のパス文字列を比較します。

宣言
public int CompareTo(string other)
引数
型 名前 説明
System.String other

比較対象の文字列です。

戻り値
型 説明
System.Int32

等価の場合は

0
、 現在のインスタンスの方が大きい場合は正の値、 現在のインスタンスの方が小さい場合は負の値を返します。

| 編集/提案 ソースを表示

EnsureNotFound()

現在のパス文字列の拡張子を変更し実際に存在しないパス文字列を取得します。

宣言
public PathString EnsureNotFound()
戻り値
型 説明
PathString

新しい実際にファイルまたはディレクトリが存在しないパス文字列です。

例外
型 条件
System.Security.SecurityException
| 編集/提案 ソースを表示

Equals(PathString)

指定したパス文字列と現在のパス文字列が等価かどうか判定します。

宣言
public bool Equals(PathString other)
引数
型 名前 説明
PathString other

判定対象のパス文字列です。

戻り値
型 説明
System.Boolean

等しい場合はtrue、等しくない場合はfalseを返します。

| 編集/提案 ソースを表示

Equals(Object)

指定したオブジェクトインスタンスの値と現在のインスタンスの値が等価かどうか判定します。

宣言
public override bool Equals(object obj)
引数
型 名前 説明
System.Object obj

判定対象のオブジェクトです。

戻り値
型 説明
System.Boolean

等しい場合はtrue、等しくない場合はfalseを返します。

上書き
System.Object.Equals(System.Object)
| 編集/提案 ソースを表示

Equals(String)

指定した文字列と現在のパス文字列が等価かどうか判定します。

宣言
public bool Equals(string other)
引数
型 名前 説明
System.String other

判定対象の文字列です。

戻り値
型 説明
System.Boolean

等しい場合はtrue、等しくない場合はfalseを返します。

| 編集/提案 ソースを表示

GetDirectoryName()

現在のパス文字列からディレクトリ情報を取得します。

宣言
public PathString GetDirectoryName()
戻り値
型 説明
PathString

現在のパス文字列のディレクトリ情報を返します。 ディレクトリ情報が存在しない場合はnullを返します。

例外
型 条件
System.Security.SecurityException
| 編集/提案 ソースを表示

GetExtension()

現在のパス文字列から拡張子情報を取得します。

宣言
public string GetExtension()
戻り値
型 説明
System.String

現在のパス文字列のピリオド付きの拡張子情報を返します。 拡張子情報が存在しない場合はnullを返します。

| 編集/提案 ソースを表示

GetFileName()

現在のパス文字列からファイル名情報を取得します。

宣言
public string GetFileName()
戻り値
型 説明
System.String

現在のパス文字列の拡張子を含むファイル名を返します。 ファイル名情報が存在しない場合はnullを返します。

| 編集/提案 ソースを表示

GetFileNameWithoutExtension()

現在のパス文字列から拡張子を除くファイル名情報を取得します。

宣言
public string GetFileNameWithoutExtension()
戻り値
型 説明
System.String

現在のパス文字列の拡張子を含まないファイル名を返します。 ファイル名情報が存在しない場合はnullを返します。

| 編集/提案 ソースを表示

GetHashCode()

現在のパス文字列のハッシュコードを取得します。

宣言
public override int GetHashCode()
戻り値
型 説明
System.Int32

現在のパス文字列が格納している文字列のハッシュ値を返します。

上書き
System.Object.GetHashCode()
| 編集/提案 ソースを表示

GetOriginalString()

コンストラクタに渡されたパス文字列を取得します。

宣言
public string GetOriginalString()
戻り値
型 説明
System.String

コンストラクタに渡されたパス文字列を返します。

| 編集/提案 ソースを表示

GetRelativePath()

現在の作業ディレクトリを基にした相対パスを取得します。

宣言
public string GetRelativePath()
戻り値
型 説明
System.String

現在のパスへの相対パスを表す文字列です。

例外
型 条件
System.PlatformNotSupportedException
| 編集/提案 ソースを表示

GetRelativePath(PathString)

指定したパスを基にした相対パスを取得します。

宣言
public string GetRelativePath(PathString relativeTo)
引数
型 名前 説明
PathString relativeTo

相対パスの基底となる絶対パスです。

戻り値
型 説明
System.String

現在のパスへの相対パスを表す文字列です。

例外
型 条件
System.ArgumentNullException

relativeToがnullに設定されています。

System.PlatformNotSupportedException

.NET Framework v4.8 上で相対パスの生成に失敗した場合に発生します。 .NET Core 3.1 以上のランタイムで実行し直してください。

| 編集/提案 ソースを表示

GetRootPath()

現在のパス文字列からルートディレクトリ情報を取得します。

宣言
public PathString GetRootPath()
戻り値
型 説明
PathString

現在のパス文字列のルートディレクトリ情報を返します。 ルートディレクトリ情報が存在しない場合はnullを返します。 現在のパス文字列がルートディレクトリを指し示す場合は現在のインスタンスを返します。

例外
型 条件
System.Security.SecurityException
| 編集/提案 ソースを表示

ToString()

パス文字列を可読な文字列へ変換します。

宣言
public override string ToString()
戻り値
型 説明
System.String

現在のパス文字列を表す可読な文字列です。

上書き
System.Object.ToString()
| 編集/提案 ソースを表示

ToString(IFormatProvider)

書式設定を利用してパス文字列を可読な文字列へ変換します。

宣言
public string ToString(IFormatProvider formatProvider)
引数
型 名前 説明
System.IFormatProvider formatProvider

書式設定サービスを提供する書式設定プロバイダです。

戻り値
型 説明
System.String

現在のパス文字列を表す可読な文字列です。

| 編集/提案 ソースを表示

ToString(String)

書式設定を利用してパス文字列を可読な文字列へ変換します。

宣言
public string ToString(string format)
引数
型 名前 説明
System.String format

書式設定文字列です。

戻り値
型 説明
System.String

現在のパス文字列を表す可読な文字列です。

脚注

書式設定文字列(format)の指定方法は、 Format(String, Object, IFormatProvider)の 説明を確認してください。

| 編集/提案 ソースを表示

ToString(String, IFormatProvider)

書式設定を利用してパス文字列を可読な文字列へ変換します。

宣言
public string ToString(string format, IFormatProvider formatProvider)
引数
型 名前 説明
System.String format

書式設定文字列です。

System.IFormatProvider formatProvider

書式設定サービスを提供する書式設定プロバイダです。

戻り値
型 説明
System.String

現在のパス文字列を表す可読な文字列です。

脚注

書式設定文字列(format)の指定方法は、 Format(String, Object, IFormatProvider)の 説明を確認してください。

演算子 一覧

| 編集/提案 ソースを表示

Addition(PathString, String)

指定された二つのパス文字列を結合します。

宣言
public static PathString operator +(PathString left, string right)
引数
型 名前 説明
PathString left

基底パスです。

System.String right

相対パスです。

戻り値
型 説明
PathString

結合されたパス文字列です。

例外
型 条件
InvalidPathFormatException

無効なパス文字列が渡されました。

System.Security.SecurityException
| 編集/提案 ソースを表示

Equality(PathString, PathString)

指定された二つのパス文字列が等価かどうか判定します。

宣言
public static bool operator ==(PathString left, PathString right)
引数
型 名前 説明
PathString left

左辺の値です。

PathString right

右辺の値です。

戻り値
型 説明
System.Boolean

等しい場合はtrue、等しくない場合はfalseを返します。

| 編集/提案 ソースを表示

Explicit(String to PathString)

通常の文字列をパス文字列へ明示的に変換(キャスト)します。

宣言
public static explicit operator PathString(string path)
引数
型 名前 説明
System.String path

パス文字列へ変換する通常の文字列です。

戻り値
型 説明
PathString
例外
型 条件
System.ArgumentNullException

pathがnullに設定されています。

InvalidPathFormatException

無効なパス文字列が渡されました。

System.Security.SecurityException
| 編集/提案 ソースを表示

GreaterThan(PathString, PathString)

左辺が右辺超過かどうか判定します。

宣言
public static bool operator>(PathString left, PathString right)
引数
型 名前 説明
PathString left

左辺の値です。

PathString right

右辺の値です。

戻り値
型 説明
System.Boolean

左辺の方が右辺より大きい場合はtrue、それ以外の場合はfalseを返します。

| 編集/提案 ソースを表示

GreaterThanOrEqual(PathString, PathString)

左辺が右辺以上かどうか判定します。

宣言
public static bool operator >=(PathString left, PathString right)
引数
型 名前 説明
PathString left

左辺の値です。

PathString right

右辺の値です。

戻り値
型 説明
System.Boolean

左辺の方が右辺より大きいか等しい場合はtrue、それ以外の場合はfalseを返します。

| 編集/提案 ソースを表示

Implicit(PathString to String)

パス文字列を通常の文字列へ暗黙的に変換(キャスト)します。

宣言
public static implicit operator string (PathString path)
引数
型 名前 説明
PathString path

通常の文字列へ変換するパス文字列です。

戻り値
型 説明
System.String
| 編集/提案 ソースを表示

Inequality(PathString, PathString)

指定された二つのパス文字列が不等価かどうか判定します。

宣言
public static bool operator !=(PathString left, PathString right)
引数
型 名前 説明
PathString left

左辺の値です。

PathString right

右辺の値です。

戻り値
型 説明
System.Boolean

等しい場合はfalse、等しくない場合はtrueを返します。

| 編集/提案 ソースを表示

LessThan(PathString, PathString)

左辺が右辺未満かどうか判定します。

宣言
public static bool operator <(PathString left, PathString right)
引数
型 名前 説明
PathString left

左辺の値です。

PathString right

右辺の値です。

戻り値
型 説明
System.Boolean

左辺の方が右辺より小さい場合はtrue、それ以外の場合はfalseを返します。

| 編集/提案 ソースを表示

LessThanOrEqual(PathString, PathString)

左辺が右辺以下かどうか判定します。

宣言
public static bool operator <=(PathString left, PathString right)
引数
型 名前 説明
PathString left

左辺の値です。

PathString right

右辺の値です。

戻り値
型 説明
System.Boolean

左辺の方が右辺より小さいか等しい場合はtrue、それ以外の場合はfalseを返します。

| 編集/提案 ソースを表示

Subtraction(PathString, PathString)

rightを基にしたleftの相対パスを計算します。

宣言
public static string operator -(PathString left, PathString right)
引数
型 名前 説明
PathString left

絶対パスです。

PathString right

基底パスです。

戻り値
型 説明
System.String

leftへの相対パスです。

例外
型 条件
System.PlatformNotSupportedException

実装

System.IFormattable
System.IEquatable<T>
System.IEquatable<T>
System.IComparable
System.IComparable<T>
System.IComparable<T>
  • 編集/提案
  • ソースを表示
Back to top Generated by DocFX