'  
'   Rebex Sample Code License
' 
'   Copyright 2026, REBEX CR s.r.o.
'   All rights reserved.
'   https://www.rebex.net/
' 
'   Permission to use, copy, modify, and/or distribute this software for any
'   purpose with or without fee is hereby granted.
' 
'   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
'   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
'   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
'   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
'   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
'   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
'   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
'   OTHER DEALINGS IN THE SOFTWARE.
' 

Imports System
Imports System.Collections.Generic
Imports System.Text

''' <summary>
''' Command line arguments parser and storage.
''' </summary>
Class Arguments
    ''' <summary>
    ''' Parses the command line and creates the instance of Arguments class
    ''' </summary>
    ''' <param name="args">Command line arguments.</param>
    Public Sub New(ByVal args As String())
        If args.Length = 0 Then
            Throw New SampleException("Archive name is missing.")
        End If

        If args.Length > 2 Then
            Throw New SampleException("Too many arguments.")
        End If

        _zipArchivePath = args(0)
        If args.Length = 2 Then
            _targetPath = args(1)
        End If
    End Sub

    ''' <summary>
    ''' Path to the ZIP archive on the disk.
    ''' </summary>
    Public ReadOnly Property ZipArchivePath() As String
        Get
            Return _zipArchivePath
        End Get
    End Property
    Private _zipArchivePath As String

    ''' <summary>
    ''' Directory into which files should be written.
    ''' </summary>
    Public ReadOnly Property TargetPath() As String
        Get
            Return _targetPath
        End Get
    End Property
    Private _targetPath As String = "."

End Class
