Index: /trunk/Include/Classes/System/IO/DirectoryInfo.ab
===================================================================
--- /trunk/Include/Classes/System/IO/DirectoryInfo.ab	(revision 403)
+++ /trunk/Include/Classes/System/IO/DirectoryInfo.ab	(revision 404)
@@ -7,4 +7,10 @@
 	Inherits FileSystemInfo
 Public
+	/*!
+	@brief	コンストラクタ
+	@author	OverTaker
+	@date	2007/11/11
+	@param	ディレクトリのパス
+	*/
 	Sub DirectoryInfo(path As String)
 		OriginalPath = path
@@ -15,14 +21,37 @@
 	End Sub
 
-	'Public Property
+	'----------------------------------------------------------------
+	' パブリック プロパティ
+	'----------------------------------------------------------------
+
+	/*!
+	@brief	ひとつ上のディレクトリを取得する
+	@author	OverTaker
+	@date	2007/11/11
+	@return	親ディレクトリ
+	*/
 	Function Parent() As DirectoryInfo
 		Return New DirectoryInfo(Path.GetDirectoryName(FullPath))
 	End Function
 
+	/*!
+	@brief	ルートディレクトリを取得する
+	@author	OverTaker
+	@date	2007/11/11
+	@return	ルートディレクトリ
+	*/
 	Function Root() As DirectoryInfo
 		Return New DirectoryInfo(Path.GetPathRoot(FullPath))
 	End Function
 
-	'Public Method
+	'----------------------------------------------------------------
+	' パブリック メソッド
+	'----------------------------------------------------------------
+
+	/*!
+	@brief	ディレクトリを作成する
+	@author	OverTaker
+	@date	2007/11/11
+	*/
 	Sub Create()
 		CreateDirectory(ToTCStr(FullPath), NULL)
@@ -32,8 +61,19 @@
 	End Sub*/
 
+	/*!
+	@brief	ディレクトリを削除する。ただしディレクトリが空の場合
+	@author	OverTaker
+	@date	2007/11/11
+	*/
 	Override Sub Delete()
 		RemoveDirectory(ToTCStr(FullPath))
 	End Sub
 
+	/*!
+	@brief	ディレクトリを削除する
+	@author	OverTaker
+	@date	2007/11/11
+	@param	ディレクトリのファイルごと消すかどうか
+	*/
 	Sub Delete(recursive As Boolean)
 		If recursive Then
@@ -73,8 +113,21 @@
 	End Function*/
 
+	/*!
+	@brief	ディレクトリの中にあるディレクトリを取得する
+	@author	OverTaker
+	@date	2007/11/11
+	@return	ディレクトリの配列
+	*/
 	Function GetDirectories() As List<DirectoryInfo>
 		Return GetDirectories("?*")
 	End Function
 
+	/*!
+	@brief	ディレクトリの中にあるディレクトリを取得する
+	@author	OverTaker
+	@date	2007/11/11
+	@param	サーチするディレクトリ名のパターン
+	@return	パターンに適合したディレクトリの配列
+	*/
 	Function GetDirectories(searchPattern As String) As List<DirectoryInfo>
 		Dim infos As List<FileSystemInfo>
@@ -91,4 +144,12 @@
 	End Function
 
+	/*!
+	@brief	ディレクトリの中にあるディレクトリを取得する
+	@author	OverTaker
+	@date	2007/11/11
+	@param	サーチするディレクトリ名のパターン
+	@param	サーチする範囲
+	@return	サーチした範囲にあるパターンに適合したディレクトリの配列
+	*/
 	Function GetDirectories(searchPattern As String, searchOption As SearchOption) As List<DirectoryInfo>
 		Select Case searchOption
@@ -111,8 +172,21 @@
 	End Function
 
+	/*!
+	@brief	ディレクトリの中にあるファイルを取得する
+	@author	OverTaker
+	@date	2007/11/11
+	@return	ファイルの配列
+	*/
 	Function GetFiles() As List<FileInfo>
 		Return GetFiles("?*")
 	End Function
 
+	/*!
+	@brief	ディレクトリの中にあるファイルを取得する
+	@author	OverTaker
+	@date	2007/11/11
+	@param	サーチするファイル名のパターン
+	@return	パターンに適合したファイルの配列
+	*/
 	Function GetFiles(searchPattern As String) As List<FileInfo>
 		Dim infos As List<FileSystemInfo>
@@ -129,4 +203,12 @@
 	End Function
 
+	/*!
+	@brief	ディレクトリの中にあるファイルを取得する
+	@author	OverTaker
+	@date	2007/11/11
+	@param	サーチするファイル名のパターン
+	@param	サーチする範囲
+	@return	サーチした範囲にあるパターンに適合したディレクトリの配列
+	*/
 	Function GetFiles(searchPattern As String, searchOption As SearchOption) As List<FileInfo>
 		Select Case searchOption
@@ -150,8 +232,21 @@
 	End Function
 
+	/*!
+	@brief	ディレクトリの中にあるディレクトリやファイルを取得する
+	@author	OverTaker
+	@date	2007/11/11
+	@return	ディレクトリやファイルの配列
+	*/
 	Function GetFileSystemInfos() As List<FileSystemInfo>
 		Return GetFileSystemInfos("?*")
 	End Function
 
+	/*!
+	@brief	ディレクトリの中にあるディレクトリやファイルを取得する
+	@author	OverTaker
+	@date	2007/11/11
+	@param	サーチする名前のパターン
+	@return	パターンに適合したディレクトリやファイルの配列
+	*/
 	Function GetFileSystemInfos(searchPattern As String) As List<FileSystemInfo>
 		Dim find As HANDLE
@@ -184,4 +279,10 @@
 	End Function
 
+	/*!
+	@brief	ディレクトリを移動する
+	@author	OverTaker
+	@date	2007/11/11
+	@param	移動先
+	*/
 	Sub MoveTo(destDirName As String)
 		If MoveFile(ToTCStr(FullPath), ToTCStr(destDirName)) = FALSE Then
Index: /trunk/Include/Classes/System/IO/Path.ab
===================================================================
--- /trunk/Include/Classes/System/IO/Path.ab	(revision 403)
+++ /trunk/Include/Classes/System/IO/Path.ab	(revision 404)
@@ -1,25 +1,43 @@
-' System/IO/Path.ab
+/*!
+@file	Classes/System/IO/Path.ab
+@brief	ファイルパス文字列を操作する
+@author	OverTaker
+*/
 
 #require <Classes/System/Environment.ab>
-
 
 Namespace System
 Namespace IO
-
 
 Class Path
 Public
 	Static AltDirectorySeparatorChar = &H2F As StrChar '/
-	Static DirectorySeparatorChar = &H5C As StrChar    '\
-	Static PathSeparator = &H3B As StrChar             ';
-	Static VolumeSeparatorChar = &H3A As StrChar       ':
-
+	Static DirectorySeparatorChar    = &H5C As StrChar '\
+	Static PathSeparator             = &H3B As StrChar ';
+	Static VolumeSeparatorChar       = &H3A As StrChar ':
+
+	/*!
+	@brief	ファイル名を取得する
+	@author	OverTaker
+	@date	
+	@param	ファイルパス
+	@return ファイル名
+	*/
 	Static Function GetFileName(path As String) As String
-		Return path.Remove(0, getLastSeparatorPosision(path) + 1)
-	End Function
-
+		CheckPath(path)
+		Return path.Remove(0, GetLastSeparatorIndex(path) + 1)
+	End Function
+
+	/*!
+	@brief	拡張子を除いたファイル名を取得する
+	@author	OverTaker
+	@date	
+	@param	ファイルパス
+	@return ファイル名
+	*/
 	Static Function GetFileNameWithoutExtension(path As String) As String
+		CheckPath(path)
 		Dim fileName = GetFileName(path) As String
-		Dim extPos = getExtensionPosition(fileName) As Long
+		Dim extPos = GetExtensionIndex(fileName) As Long
 		If extPos = -1 Then Return ""
 
@@ -27,5 +45,11 @@
 	End Function
 
-	'手抜き
+	/*!
+	@brief	ランダムなファイル名を取得する
+	@author	OverTaker
+	@date	
+	@param	ファイルパス
+	@return ファイル名
+	*/
 	Static Function GetRandomFileName() As String
 		Randomize
@@ -35,6 +59,14 @@
 	End Function
 
+	/*!
+	@brief	ファイルの拡張子を取得する
+	@author	OverTaker
+	@date	
+	@param  ファイルパス
+	@return 拡張子(.を含む)
+	*/
 	Static Function GetExtension(path As String) As String
-		Dim extPos = getExtensionPosition(path) As Long
+		CheckPath(path)
+		Dim extPos = GetExtensionIndex(path) As Long
 		If extPos = -1 Then Return ""
 
@@ -42,14 +74,30 @@
 	End Function
 
+	/*!
+	@brief	ファイル拡張子を変更する
+	@author	OverTaker
+	@date	
+	@param  拡張子(.を含む)
+	@return 拡張子を変更したファイルパス
+	*/
 	Static Function ChangeExtension(path As String, extension As String) As String
-		Dim extPos = getExtensionPosition(path) As Long
+		Dim extPos = GetExtensionIndex(path) As Long
 		If extPos => 0 Then
 			path = path.Remove(extPos)
 		End If
 
+		CheckPath(path)
 		Return path + extension
 	End Function
 
-	Static Function HasExtension(ByRef path As String) As Boolean
+	/*!
+	@brief	ファイルパスの拡張子が含まれるかどうか
+	@author	OverTaker
+	@date	
+	@param  ファイルパス
+	@return 拡張子があればTure,なければFalse
+	*/
+	Static Function HasExtension(path As String) As Boolean
+		CheckPath(path)
 		If GetExtension(path) <> "" Then
 			Return True
@@ -59,4 +107,10 @@
 	End Function
 
+	/*!
+	@brief	一時ファイルを作成し、ファイルパスを取得する
+	@author	OverTaker
+	@date	
+	@return 一時ファイルを示すファイルパス
+	*/
 	Static Function GetTempFileName() As String
 		Dim tempPathSize = __GetTempPath(0, 0)
@@ -76,5 +130,11 @@
 		Return New String(tempFileName, len As Long)
 	End Function
-
+	
+	/*!
+	@brief	システムの一時フォルダを取得する
+	@author	OverTaker
+	@date	
+	@return ファイルパス
+	*/
 	Static Function GetTempPath() As String
 		Dim size = __GetTempPath(0, 0)
@@ -85,5 +145,13 @@
 	End Function
 
+	/*!
+	@brief	フルパスを取得する
+	@author	OverTaker
+	@date	
+	@param  ファイルパス
+	@return ファイルパス
+	*/
 	Static Function GetFullPath(path As String) As String
+		CheckPath(path)
 		If IsPathRooted(path) Then
 			Return path
@@ -93,6 +161,14 @@
 	End Function
 
+	/*!
+	@brief	ひとつ上のディレクトリを取得する
+	@author	OverTaker
+	@date	
+	@param  ファイルパス
+	@return ひとつ上のディレクトリを示すファイルパス
+	*/
 	Static Function GetDirectoryName(path As String) As String
-		Dim lastSepPos = getLastSeparatorPosision(path) As Long
+		CheckPath(path)
+		Dim lastSepPos = GetLastSeparatorIndex(path) As Long
 		If lastSepPos = -1 Then Return ""
 
@@ -104,5 +180,13 @@
 	End Function
 
+	/*!
+	@brief	ルートディレクトリを取得する
+	@author	OverTaker
+	@date	
+	@param  ファイルパス
+	@return ルートディレクトリを示すパス
+	*/
 	Static Function GetPathRoot(path As String) As String
+		CheckPath(path)
 		If IsPathRooted(path) Then
 			Return path.Remove(3)
@@ -112,5 +196,13 @@
 	End Function
 
+	/*!
+	@brief	パスにルートディレクトリが含まれるかどうか
+	@author	OverTaker
+	@date	
+	@param  ファイルパス
+	@return 含まれる場合True,そうでない場合False
+	*/
 	Static Function IsPathRooted(path As String) As Boolean
+		CheckPath(path)
 		If path.IndexOf(Chr$(VolumeSeparatorChar), 1, 1) = 1 Then
 			Return True
@@ -120,5 +212,15 @@
 	End Function
 
+	/*!
+	@brief	二つのパスを結合します
+	@author	OverTaker
+	@date	
+	@param  結合されるファイルパス
+	@param  結合するファイルパス
+	@return 結合されたファイルパス
+	*/
 	Static Function Combine(path1 As String, path2 As String) As String
+		CheckPath(path1)
+		CheckPath(path2)
 		If path1.LastIndexOf(VolumeSeparatorChar) And path1.Length = 2 Then
 			Return path1 + path2
@@ -133,18 +235,44 @@
 
 Private
-	Static Function getExtensionPosition(path As String) As Long
-		Dim lastSepPos = getLastSeparatorPosision(path) As Long
-		If lastSepPos = -1 Then 
-			lastSepPos = 0
-		End If
-		getExtensionPosition = path.LastIndexOf(Asc("."), ELM(path.Length), path.Length - lastSepPos)
-	End Function
-
-	Static Function getLastSeparatorPosision(path As String) As Long
-		Dim lastSepPos = path.LastIndexOf(DirectorySeparatorChar) As Long
-		If lastSepPos <> -1 Then Return lastSepPos
-
-		lastSepPos = path.LastIndexOf(VolumeSeparatorChar)
-		Return lastSepPos
+	Static Const InvalidPathChars = Ex"\q<>|\0\t" As String
+
+	/*!
+	@brief	無効なパス文字列がないか調べる
+	@author	OverTaker
+	@date	
+	@param  ファイルパス
+	*/
+	Static Sub CheckPath(path As String)
+		Dim i As Long
+		For i = 0 To ELM(InvalidPathChars.Length)
+			If path.Contains(InvalidPathChars.Substring(i, 1)) Then
+				Throw
+			End If
+		Next
+	End Sub
+
+	/*!
+	@brief	ファイルの拡張子の位置を取得する
+	@author	OverTaker
+	@date	
+	@param  ファイルパス
+	@return 0から始まるインデックス値。みつからない場合-1
+	*/
+	Static Function GetExtensionIndex(path As String) As Long
+		Dim lastSepIndex = GetLastSeparatorIndex(path) As Long
+		If lastSepIndex = -1 Then lastSepIndex = 0
+		Return path.LastIndexOf(Asc("."), ELM(path.Length), path.Length - lastSepIndex)
+	End Function
+
+	/*!
+	@brief	最も後ろにあるディレクトリ区切り文字の位置を取得する
+	@author	OverTaker
+	@date	
+	@param  ファイルパス
+	@return 0から始まるインデックス値。みつからない場合-1
+	*/
+	Static Function GetLastSeparatorIndex(path As String) As Long
+		Return System.Math.Max( path.LastIndexOf(DirectorySeparatorChar),
+								path.LastIndexOf(VolumeSeparatorChar) )
 	End Function
 End Class
