' *
' * The project site is at: http://sourceforge.jp/projects/fishbornas/
' *
' * First author tiritomato 2012.
' *
' * Distributed under the FishbornArchiveShelf License (See
' *  file "Licenses/License.txt" contained in a project, or the following link.
' *  http://sourceforge.jp/projects/fishbornas/scm/svn/blobs/head/trunk/Licenses/License.txt)
' *
' * 2012.06.07 Initial Revision (tiritomato)
' *

Partial Public Class Logic
    Public Class CommandlineParser

        Public Shared Function Parse(ByVal Cmd As String) As ParseResult
            Return New ParseResult(Cmd)
        End Function

        Public Shared Function Split(ByVal Cmd As String) As System.Collections.Generic.List(Of String)
            Split = New System.Collections.Generic.List(Of String)
            For Each Match As System.Text.RegularExpressions.Match In System.Text.RegularExpressions.Regex.Matches(Cmd, """([^""]*?)""|[^\s""]+")
                Split.Add(Match.Groups(IIf(String.IsNullOrEmpty(Match.Groups(1).Value), 0, 1)).Value)
            Next
        End Function

    End Class

End Class
