[Runtime] Excluded VFP functions that are not ready

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//

// String Functions

USING System
USING System.Collections.Generic
USING System.Text
USING System.IO

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/addbs/*" />
/// <seealso cref='M:XSharp.VFP.Functions.DefaultExt(System.String)' />
/// <seealso cref='M:XSharp.VFP.Functions.JustDrive(System.String)' />
/// <seealso cref='M:XSharp.VFP.Functions.JustExt(System.String)' />
/// <seealso cref='M:XSharp.VFP.Functions.JustFName(System.String)' />
/// <seealso cref='M:XSharp.VFP.Functions.JustPath(System.String)' />
/// <seealso cref='M:XSharp.VFP.Functions.JustStem(System.String)' />
FUNCTION AddBs (cPath AS STRING)
    IF String.IsNullOrEmpty(cPath)
        RETURN ""
    ENDIF
    VAR delim := Path.DirectorySeparatorChar:ToString()
    cPath := cPath:TrimEnd()
    IF ! cPath.EndsWith(delim)
        cPath += delim
    ENDIF
    RETURN cPath

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justdrive/*" />
/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justcommon/*" />
FUNCTION JustDrive(cPath AS STRING)
    IF String.IsNullOrEmpty(cPath)
        RETURN ""
    ENDIF
    VAR result := System.IO.Directory.GetDirectoryRoot(cPath)
    result := result:Replace(Path.DirectorySeparatorChar:ToString(),"")
    RETURN result

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justdrive/*" />
/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justcommon/*" />
FUNCTION JustExt(cPath AS STRING)
    IF String.IsNullOrEmpty(cPath)
        RETURN ""
    ENDIF
    VAR result := Path.GetExtension(cPath)
    RETURN result

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justfname/*" />
/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justcommon/*" />
FUNCTION JustFName(cPath AS STRING)
    IF String.IsNullOrEmpty(cPath)
        RETURN ""
    ENDIF
    VAR result := Path.GetFileName(cPath)
    RETURN result

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justpath/*" />
/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justcommon/*" />
FUNCTION JustPath(cPath AS STRING)
    IF String.IsNullOrEmpty(cPath)
        RETURN ""
    ENDIF
    LOCAL cPathChar := Path.DirectorySeparatorChar:ToString() AS STRING
    LOCAL result := cPath AS STRING
    IF result:IndexOf(cPathChar) >= 0
        result := result:Substring(0, result:LastIndexOf(cPathChar) -1)
    ENDIF
    RETURN result

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/juststem/*" />
/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justcommon/*" />
FUNCTION JustStem(cPath AS STRING)
    IF String.IsNullOrEmpty(cPath)
        RETURN ""
    ENDIF
    VAR result := Path.GetFileNameWithoutExtension(cPath)
    RETURN result
#ifdef NOTREADY

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/at/*" />
FUNCTION At(cSearchExpression AS STRING, cExpressionSearched AS STRING, nOccurrence := 1 AS DWORD) AS DWORD
	LOCAL position := 0 AS DWORD
	IF ( cExpressionSearched != NULL .AND. cSearchExpression != NULL )
		IF cExpressionSearched:Length != 0 .AND. cSearchExpression:Length != 0
            DO WHILE nOccurrence  > 0
			    position := (DWORD) cExpressionSearched:IndexOf(cSearchExpression, (INT) position,StringComparison.Ordinal)
                nOccurrence -= 1
            ENDDO
		END IF
	ENDIF
	RETURN position

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/at_c/*" />
FUNCTION At_C(cSearchExpression AS STRING, cExpressionSearched AS STRING, nOccurrence := 1 AS DWORD) AS DWORD
	RETURN At(cSearchExpression, cExpressionSearched, nOccurrence)

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/atc/*" />
FUNCTION AtC(cSearchExpression AS STRING, cExpressionSearched AS STRING, nOccurrence := 1 AS DWORD) AS DWORD
	LOCAL position := 0 AS DWORD
	IF ( cExpressionSearched != NULL .AND. cSearchExpression != NULL )
		IF cExpressionSearched:Length != 0 .AND. cSearchExpression:Length != 0
            DO WHILE nOccurrence  > 0
			    position := (DWORD) cExpressionSearched:IndexOf(cSearchExpression, (INT) position,StringComparison.OrdinalIgnoreCase)
                nOccurrence -= 1
            ENDDO
		END IF
	ENDIF
	RETURN position

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/atcc/*" />
FUNCTION AtCC(cSearchExpression AS STRING, cExpressionSearched AS STRING, nOccurrence := 1 AS DWORD) AS DWORD
	RETURN AtC(cSearchExpression, cExpressionSearched, nOccurrence)
#endif

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//

// String Functions

USING System
USING System.Collections.Generic
USING System.Text
USING System.IO

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/addbs/*" />
/// <seealso cref='M:XSharp.VFP.Functions.DefaultExt(System.String)' />
/// <seealso cref='M:XSharp.VFP.Functions.JustDrive(System.String)' />
/// <seealso cref='M:XSharp.VFP.Functions.JustExt(System.String)' />
/// <seealso cref='M:XSharp.VFP.Functions.JustFName(System.String)' />
/// <seealso cref='M:XSharp.VFP.Functions.JustPath(System.String)' />
/// <seealso cref='M:XSharp.VFP.Functions.JustStem(System.String)' />
FUNCTION AddBs (cPath AS STRING)
    IF String.IsNullOrEmpty(cPath)
        RETURN ""
    ENDIF
    VAR delim := Path.DirectorySeparatorChar:ToString()
    cPath := cPath:TrimEnd()
    IF ! cPath.EndsWith(delim)
        cPath += delim
    ENDIF
    RETURN cPath

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justdrive/*" />
/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justcommon/*" />
FUNCTION JustDrive(cPath AS STRING)
    IF String.IsNullOrEmpty(cPath)
        RETURN ""
    ENDIF
    VAR result := System.IO.Directory.GetDirectoryRoot(cPath)
    result := result:Replace(Path.DirectorySeparatorChar:ToString(),"")
    RETURN result

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justdrive/*" />
/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justcommon/*" />
FUNCTION JustExt(cPath AS STRING)
    IF String.IsNullOrEmpty(cPath)
        RETURN ""
    ENDIF
    VAR result := Path.GetExtension(cPath)
    RETURN result

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justfname/*" />
/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justcommon/*" />
FUNCTION JustFName(cPath AS STRING)
    IF String.IsNullOrEmpty(cPath)
        RETURN ""
    ENDIF
    VAR result := Path.GetFileName(cPath)
    RETURN result

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justpath/*" />
/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justcommon/*" />
FUNCTION JustPath(cPath AS STRING)
    IF String.IsNullOrEmpty(cPath)
        RETURN ""
    ENDIF
    LOCAL cPathChar := Path.DirectorySeparatorChar:ToString() AS STRING
    LOCAL result := cPath AS STRING
    IF result:IndexOf(cPathChar) >= 0
        result := result:Substring(0, result:LastIndexOf(cPathChar) -1)
    ENDIF
    RETURN result

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/juststem/*" />
/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/justcommon/*" />
FUNCTION JustStem(cPath AS STRING)
    IF String.IsNullOrEmpty(cPath)
        RETURN ""
    ENDIF
    VAR result := Path.GetFileNameWithoutExtension(cPath)
    RETURN result

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/at/*" />
FUNCTION At(cSearchExpression AS STRING, cExpressionSearched AS STRING, nOccurrence := 1 AS DWORD) AS DWORD
	LOCAL position := 0 AS DWORD
	IF ( cExpressionSearched != NULL .AND. cSearchExpression != NULL )
		IF cExpressionSearched:Length != 0 .AND. cSearchExpression:Length != 0
            DO WHILE nOccurrence  > 0
			    position := (DWORD) cExpressionSearched:IndexOf(cSearchExpression, (INT) position,StringComparison.Ordinal)
                nOccurrence -= 1
            ENDDO
		END IF
	ENDIF
	RETURN position

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/at_c/*" />
FUNCTION At_C(cSearchExpression AS STRING, cExpressionSearched AS STRING, nOccurrence := 1 AS DWORD) AS DWORD
	RETURN At(cSearchExpression, cExpressionSearched, nOccurrence)

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/atc/*" />
FUNCTION AtC(cSearchExpression AS STRING, cExpressionSearched AS STRING, nOccurrence := 1 AS DWORD) AS DWORD
	LOCAL position := 0 AS DWORD
	IF ( cExpressionSearched != NULL .AND. cSearchExpression != NULL )
		IF cExpressionSearched:Length != 0 .AND. cSearchExpression:Length != 0
            DO WHILE nOccurrence  > 0
			    position := (DWORD) cExpressionSearched:IndexOf(cSearchExpression, (INT) position,StringComparison.OrdinalIgnoreCase)
                nOccurrence -= 1
            ENDDO
		END IF
	ENDIF
	RETURN position

/// <include file="VfpRuntimeDocs.xml" path="Runtimefunctions/atcc/*" />
FUNCTION AtCC(cSearchExpression AS STRING, cExpressionSearched AS STRING, nOccurrence := 1 AS DWORD) AS DWORD
	RETURN AtC(cSearchExpression, cExpressionSearched, nOccurrence)


Fix #362, Problem with File() function with wildcards

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//

USING System.Collections.Generic
USING System.IO
USING System.Linq
/// <summary>This delegate is used when you want to implement your own function for the logic behind the File() function. You can register your own FileSearcher by calling the RegisterFileSearch() function.</summary>
/// <seealso cref='M:XSharp.Core.Functions.RegisterFileSearch(XSharp.FileSearcher)' >RegisterFileSearch() Function</seealso>

PUBLIC DELEGATE XSharp.FileSearcher(cIn AS STRING) AS STRING
INTERNAL STATIC CLASS XSharp.FileSearch
    STATIC PRIVATE foundEntries	:= List<OBJECT>{} AS List<OBJECT>
    STATIC PRIVATE enumerator   := NULL AS IEnumerator<OBJECT>
    STATIC PRIVATE currentItem	:= NULL AS OBJECT
    STATIC PRIVATE isAtEnd		:= TRUE AS LOGIC
    STATIC Worker := FileSearchWorker AS FileSearcher

    CONST timeFormat := "HH:MM:ss" AS STRING

    INTERNAL STATIC METHOD FFCount( filespec AS STRING , attributes AS DWORD ) AS DWORD
        FindFirst(filespec,attributes)
        RETURN (DWORD)foundEntries:Count

    INTERNAL STATIC METHOD FindFirst( filespec AS STRING , attributes AS DWORD ) AS LOGIC
        LOCAL lRet := FALSE AS LOGIC

        TRY

            XSharp.IO.File.ClearErrorState()

            // Split filespec in path and mask
            // when path is empty then path is current directory
            // make sure that we only search in the given path
            LOCAL cPath AS STRING
            LOCAL cMask AS STRING
            cPath := Path.GetDirectoryName(filespec)
            cMask := Path.GetFileName(filespec)
            IF String.IsNullOrEmpty(cPath)
                cPath := System.Environment.CurrentDirectory
            ENDIF
            foundEntries:Clear()
            IF attributes == FA_VOLUME
                LOCAL allDrives := DriveInfo.GetDrives() AS DriveInfo[]
                FOREACH drive AS DriveInfo IN allDrives
                    foundEntries:Add(drive)
                NEXT
            ELSE
                LOCAL oDirInfo AS DirectoryInfo
                oDirInfo := DirectoryInfo{cPath}

                LOCAL files := oDirInfo:GetFiles(cMask) AS FileInfo[]
                //VAR selectedFiles := FROM FileInfo IN files WHERE ( FileInfo:Attributes & (FileAttributes) (attributes + FA_NORMAL)) != 0 SELECT FileInfo
                FOREACH file AS FileInfo IN files
                    foundEntries:Add(file)
                NEXT

                IF (attributes & FA_DIRECTORY) == (DWORD) FA_DIRECTORY
                    LOCAL directories := oDirInfo:GetDirectories(cMask) AS FileSystemInfo[]
                    VAR selectedDirs := FROM DirectoryInfo IN directories WHERE (DirectoryInfo:Attributes & (FileAttributes) (attributes + FA_NORMAL) ) != 0 SELECT DirectoryInfo
                    FOREACH directory AS DirectoryInfo IN selectedDirs
                        foundEntries:Add(directory)
                    NEXT
                ENDIF
            ENDIF
            enumerator := foundEntries:GetEnumerator()
            enumerator:Reset()
            isAtEnd := !enumerator:MoveNext()
            IF  !isAtEnd
                currentItem := enumerator:Current
            ENDIF
            lRet := foundEntries:Count > 0

        CATCH oEx AS Exception

            XSharp.IO.File.SetErrorState(oEx)
            lRet := FALSE

        END TRY

    RETURN lRet

    INTERNAL STATIC METHOD FindNext() AS LOGIC
        IF !isAtEnd
            isAtEnd := !enumerator:MoveNext()
            IF !isAtEnd
                currentItem := enumerator:Current
            ENDIF
        ENDIF
        RETURN !isAtEnd

    INTERNAL STATIC METHOD FName() AS STRING
        LOCAL name := "" AS STRING
        IF !isAtEnd
            IF (currentItem IS DriveInfo)
                name := ((DriveInfo)currentItem):Name
            ELSEIF (currentItem IS FileInfo)
                name := ((FileInfo)currentItem):Name
            ELSEIF (currentItem IS DirectoryInfo)
                name := ((DirectoryInfo) currentItem):Name
            ENDIF
        ENDIF
        RETURN name

    INTERNAL STATIC METHOD FSize() AS DWORD
        LOCAL size := 0 AS INT
        IF !isAtEnd
            IF currentItem IS DriveInfo
                IF ((DriveInfo) currentItem):IsReady
                    size := (INT)((DriveInfo) currentItem):TotalSize
                ENDIF
            ELSEIF (currentItem IS FileInfo)
                size := (INT)((FileInfo)currentItem):Length
            ELSEIF currentItem IS DirectoryInfo
                size := (INT)((DirectoryInfo) currentItem):GetFileSystemInfos().LongLength
            ENDIF
        ENDIF
        RETURN (DWORD) size

    INTERNAL STATIC METHOD FTime() AS STRING
        LOCAL time := "00:00:00" AS STRING
        IF !isAtEnd
            IF (currentItem IS FileInfo)
                time := ((FileInfo)currentItem):LastWriteTime.ToString(timeFormat)
            ELSEIF currentItem IS DirectoryInfo
                time := ((DirectoryInfo) currentItem):LastWriteTime.ToString(timeFormat)
            ENDIF
        ENDIF
        RETURN  time

    INTERNAL STATIC METHOD FDate() AS DateTime
        LOCAL time := DateTime.MinValue AS DateTime
        IF !isAtEnd
            IF (currentItem IS FileInfo)
                time := ((FileInfo)currentItem):LastWriteTime
            ELSEIF currentItem IS DirectoryInfo
                time := ((DirectoryInfo) currentItem):LastWriteTime
            ENDIF
        ENDIF
        RETURN  time

    INTERNAL STATIC METHOD FAttrib() AS DWORD
        LOCAL attributes := 0x00000008 AS INT
        IF !isAtEnd
            IF (currentItem IS FileInfo)
                attributes := (INT)((FileInfo)currentItem):Attributes
            ELSEIF currentItem IS DirectoryInfo
                attributes := (INT)((DirectoryInfo) currentItem):Attributes
            ENDIF
        ENDIF
        RETURN  (DWORD)attributes

        END CLASS

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/ffcount/*" />
FUNCTION FFCount(pszFileSpec AS STRING,dwAttributes AS DWORD) AS DWORD
    RETURN XSharp.FileSearch.FFCount(pszFileSpec,dwAttributes)

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/ffirst/*" />
FUNCTION FFirst(pszFileSpec AS STRING,kAttributes AS DWORD) AS LOGIC
    RETURN XSharp.FileSearch.FindFirst(pszFileSpec,kAttributes)

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/fattrib/*" />
FUNCTION FAttrib() AS DWORD
    RETURN XSharp.FileSearch.FAttrib()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/fdate/*" />
FUNCTION FDate() AS DateTime
    RETURN XSharp.FileSearch.FDate()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/fname/*" />
FUNCTION FName() AS STRING
    RETURN XSharp.FileSearch.FName()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/fnext/*" />
FUNCTION FNext() AS LOGIC
    RETURN XSharp.FileSearch.FindNext()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/fsize/*" />
FUNCTION FSize() AS DWORD
    RETURN XSharp.FileSearch.FSize()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/ftime/*" />
FUNCTION FTime() AS STRING
    RETURN XSharp.FileSearch.FTime()

// Worker function with normal file search worker
INTERNAL FUNCTION FileSearchWorker(cFile AS STRING) AS STRING
    LOCAL lFirst AS LOGIC
    IF System.IO.File.Exists(cFile)
        RETURN Path.GetFullPath( cFile )
    ENDIF
    LOCAL aPaths AS STRING[]
    aPaths := __GetSearchPaths()
    lFirst := TRUE
    FOREACH cPath AS STRING IN aPaths
        VAR cTemp := System.IO.Path.Combine(cPath, cFile)
        IF lFirst
            // store the first path that we looked in even when the file is not found
            // to be compatible with VO
            RuntimeState.LastFound := cTemp
            lFirst := FALSE
        ENDIF
        IF System.IO.File.Exists(cTemp)
            RuntimeState.LastFound := cTemp
            RETURN cTemp
        ENDIF
    NEXT
    RETURN ""

    /// <summary>
    /// Register Worker function for File Search API.
    /// </summary>
    /// <param name="newWorker">Function that implements the worker. Must implement the FileSearcher delegate, so take STRING parameter and return a STRING</param>
    /// <returns>
    /// current Worker function
    /// </returns>
    /// <seealso cref="T:XSharp.FileSearcher">FileSearcher Delegate </seealso>
FUNCTION RegisterFileSearch(newWorker AS FileSearcher) AS FileSearcher
    LOCAL oldWorker AS FileSearcher
    oldWorker := XSharp.FileSearch.Worker
    IF newWorker != NULL
        XSharp.FileSearch.Worker := newWorker
    ENDIF
    RETURN oldWorker

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/file/*" />
FUNCTION File(cFileSpec AS STRING) AS LOGIC
    LOCAL lHasWildCards AS LOGIC
    LOCAL aPaths AS STRING[]
    LOCAL lFirst AS LOGIC
    TRY
        cFileSpec := cFileSpec?:Trim()
        IF String.IsNullOrEmpty(cFileSpec)
            RETURN FALSE
        ENDIF
        lHasWildCards := cFileSpec:IndexOfAny( <CHAR>{ '*', '?' } ) > 0
        RuntimeState.LastFound := ""
        IF ! lHasWildCards
            VAR cFound := XSharp.FileSearch.Worker(cFileSpec)
            IF ! String.IsNullOrEmpty(cFound)
                RuntimeState.LastFound := cFound
                RETURN TRUE
            ENDIF
        ELSE
            // wildcard, so use Directory.GetFiles()
            LOCAL files     AS STRING[]

            IF Path.IsPathRooted(cFileSpec)
                files := Directory.GetFiles( Path.GetDirectoryName( cFileSpec ), Path.GetFileName( cFileSpec ) )
                IF files:Length > 0
                    RuntimeState.LastFound := files[0]
                    RETURN TRUE
                ELSE
                    // store the first path that we looked in even when the file is not found
                    // to be compatible with VO
                    RuntimeState.LastFound := cFileSpec
                    RETURN FALSE
                ENDIF
            ELSE
                // Look in current directory first and if that fails through the whole normal search list
                IF __FileHelper(Environment.CurrentDirectory, cFileSpec, FALSE )
                    RETURN TRUE
                ENDIF
                aPaths := __GetSearchPaths()
                lFirst := TRUE
                FOREACH cPath AS STRING IN aPaths
                    IF __FileHelper(cPath, cFileSpec, lFirst )
                        RETURN TRUE
                    ENDIF
                    lFirst := FALSE
                NEXT
            ENDIF
        ENDIF
    CATCH e as Exception
        XSharp.IO.File.SetErrorState(e)
    END TRY
    RETURN FALSE

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/FPathName/*" />
FUNCTION FPathName() AS STRING
    RETURN RuntimeState.LastFound

INTERNAL FUNCTION __FileHelper(cPath AS STRING, cFileSpec AS STRING, lSavePath AS LOGIC) AS LOGIC
    LOCAL cTemp AS STRING
    LOCAL cFile AS STRING
    LOCAL files AS STRING[]
    IF ! System.IO.Directory.Exists(cPath)
        RETURN FALSE
    ENDIF
    cTemp := System.IO.Path.Combine(cPath, cFileSpec)
    cPath := System.IO.Path.GetDirectoryName(cTemp)
    cFile := System.IO.Path.GetFileName(cTemp)
    IF ! System.IO.Directory.Exists(cPath)
        RETURN FALSE
    ENDIF
    files := System.IO.Directory.GetFiles(cPath, cFile)
    IF files:Length > 0
        RuntimeState.LastFound := files[0]
    ELSEIF lSavePath
        RuntimeState.LastFound := cTemp
    ENDIF
    RETURN files:Length > 0

INTERNAL FUNCTION __GetSearchPaths() AS STRING[]
// Not found, now use the path settings from SetDefault and SetPath()
// if SetPath() is empty then we look through the Environment variable Path
LOCAL aDefault AS STRING[]
aDefault := SetPathArray()
IF aDefault != NULL
    RETURN aDefault
ENDIF

VAR aPaths := List<STRING>{}
VAR cPath  := SetDefault()
IF !String.IsNullOrEmpty(cPath)
    aPaths:Add(cPath)
ENDIF
cPath := SetPath()
IF String.IsNullOrEmpty(cPath)
    cPath := GetEnv("PATH")
ENDIF
IF !String.IsNullOrEmpty(cPath)
    VAR aElements := cPath:Split(<CHAR>{ ';' }, StringSplitOptions.RemoveEmptyEntries )
    aPaths:AddRange(aElements)
ENDIF
aDefault := aPaths:ToArray()
SetPathArray(aDefault)
RETURN aDefault

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//

USING System.Collections.Generic
USING System.IO
USING System.Linq
/// <summary>This delegate is used when you want to implement your own function for the logic behind the File() function. You can register your own FileSearcher by calling the RegisterFileSearch() function.</summary>
/// <seealso cref='M:XSharp.Core.Functions.RegisterFileSearch(XSharp.FileSearcher)' >RegisterFileSearch() Function</seealso>

PUBLIC DELEGATE XSharp.FileSearcher(cIn AS STRING) AS STRING
INTERNAL STATIC CLASS XSharp.FileSearch
    STATIC PRIVATE foundEntries	:= List<OBJECT>{} AS List<OBJECT>
    STATIC PRIVATE enumerator   := NULL AS IEnumerator<OBJECT>
    STATIC PRIVATE currentItem	:= NULL AS OBJECT
    STATIC PRIVATE isAtEnd		:= TRUE AS LOGIC
    STATIC Worker := FileSearchWorker AS FileSearcher

    CONST timeFormat := "HH:MM:ss" AS STRING

    INTERNAL STATIC METHOD FFCount( filespec AS STRING , attributes AS DWORD ) AS DWORD
        FindFirst(filespec,attributes)
        RETURN (DWORD)foundEntries:Count

    INTERNAL STATIC METHOD FindFirst( filespec AS STRING , attributes AS DWORD ) AS LOGIC
        LOCAL lRet := FALSE AS LOGIC

        TRY

            XSharp.IO.File.ClearErrorState()

            // Split filespec in path and mask
            // when path is empty then path is current directory
            // make sure that we only search in the given path
            LOCAL cPath AS STRING
            LOCAL cMask AS STRING
            cPath := Path.GetDirectoryName(filespec)
            cMask := Path.GetFileName(filespec)
            IF String.IsNullOrEmpty(cPath)
                cPath := System.Environment.CurrentDirectory
            ENDIF
            foundEntries:Clear()
            IF attributes == FA_VOLUME
                LOCAL allDrives := DriveInfo.GetDrives() AS DriveInfo[]
                FOREACH drive AS DriveInfo IN allDrives
                    foundEntries:Add(drive)
                NEXT
            ELSE
                LOCAL oDirInfo AS DirectoryInfo
                oDirInfo := DirectoryInfo{cPath}

                LOCAL files := oDirInfo:GetFiles(cMask) AS FileInfo[]
                //VAR selectedFiles := FROM FileInfo IN files WHERE ( FileInfo:Attributes & (FileAttributes) (attributes + FA_NORMAL)) != 0 SELECT FileInfo
                FOREACH file AS FileInfo IN files
                    foundEntries:Add(file)
                NEXT

                IF (attributes & FA_DIRECTORY) == (DWORD) FA_DIRECTORY
                    LOCAL directories := oDirInfo:GetDirectories(cMask) AS FileSystemInfo[]
                    VAR selectedDirs := FROM DirectoryInfo IN directories WHERE (DirectoryInfo:Attributes & (FileAttributes) (attributes + FA_NORMAL) ) != 0 SELECT DirectoryInfo
                    FOREACH directory AS DirectoryInfo IN selectedDirs
                        foundEntries:Add(directory)
                    NEXT
                ENDIF
            ENDIF
            enumerator := foundEntries:GetEnumerator()
            enumerator:Reset()
            isAtEnd := !enumerator:MoveNext()
            IF  !isAtEnd
                currentItem := enumerator:Current
            ENDIF
            lRet := foundEntries:Count > 0

        CATCH oEx AS Exception

            XSharp.IO.File.SetErrorState(oEx)
            lRet := FALSE

        END TRY

    RETURN lRet

    INTERNAL STATIC METHOD FindNext() AS LOGIC
        IF !isAtEnd
            isAtEnd := !enumerator:MoveNext()
            IF !isAtEnd
                currentItem := enumerator:Current
            ENDIF
        ENDIF
        RETURN !isAtEnd

    INTERNAL STATIC METHOD FName() AS STRING
        LOCAL name := "" AS STRING
        IF !isAtEnd
            IF (currentItem IS DriveInfo)
                name := ((DriveInfo)currentItem):Name
            ELSEIF (currentItem IS FileInfo)
                name := ((FileInfo)currentItem):Name
            ELSEIF (currentItem IS DirectoryInfo)
                name := ((DirectoryInfo) currentItem):Name
            ENDIF
        ENDIF
        RETURN name

    INTERNAL STATIC METHOD FSize() AS DWORD
        LOCAL size := 0 AS INT
        IF !isAtEnd
            IF currentItem IS DriveInfo
                IF ((DriveInfo) currentItem):IsReady
                    size := (INT)((DriveInfo) currentItem):TotalSize
                ENDIF
            ELSEIF (currentItem IS FileInfo)
                size := (INT)((FileInfo)currentItem):Length
            ELSEIF currentItem IS DirectoryInfo
                size := (INT)((DirectoryInfo) currentItem):GetFileSystemInfos().LongLength
            ENDIF
        ENDIF
        RETURN (DWORD) size

    INTERNAL STATIC METHOD FTime() AS STRING
        LOCAL time := "00:00:00" AS STRING
        IF !isAtEnd
            IF (currentItem IS FileInfo)
                time := ((FileInfo)currentItem):LastWriteTime.ToString(timeFormat)
            ELSEIF currentItem IS DirectoryInfo
                time := ((DirectoryInfo) currentItem):LastWriteTime.ToString(timeFormat)
            ENDIF
        ENDIF
        RETURN  time

    INTERNAL STATIC METHOD FDate() AS DateTime
        LOCAL time := DateTime.MinValue AS DateTime
        IF !isAtEnd
            IF (currentItem IS FileInfo)
                time := ((FileInfo)currentItem):LastWriteTime
            ELSEIF currentItem IS DirectoryInfo
                time := ((DirectoryInfo) currentItem):LastWriteTime
            ENDIF
        ENDIF
        RETURN  time

    INTERNAL STATIC METHOD FAttrib() AS DWORD
        LOCAL attributes := 0x00000008 AS INT
        IF !isAtEnd
            IF (currentItem IS FileInfo)
                attributes := (INT)((FileInfo)currentItem):Attributes
            ELSEIF currentItem IS DirectoryInfo
                attributes := (INT)((DirectoryInfo) currentItem):Attributes
            ENDIF
        ENDIF
        RETURN  (DWORD)attributes

        END CLASS

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/ffcount/*" />
FUNCTION FFCount(pszFileSpec AS STRING,dwAttributes AS DWORD) AS DWORD
    RETURN XSharp.FileSearch.FFCount(pszFileSpec,dwAttributes)

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/ffirst/*" />
FUNCTION FFirst(pszFileSpec AS STRING,kAttributes AS DWORD) AS LOGIC
    RETURN XSharp.FileSearch.FindFirst(pszFileSpec,kAttributes)

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/fattrib/*" />
FUNCTION FAttrib() AS DWORD
    RETURN XSharp.FileSearch.FAttrib()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/fdate/*" />
FUNCTION FDate() AS DateTime
    RETURN XSharp.FileSearch.FDate()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/fname/*" />
FUNCTION FName() AS STRING
    RETURN XSharp.FileSearch.FName()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/fnext/*" />
FUNCTION FNext() AS LOGIC
    RETURN XSharp.FileSearch.FindNext()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/fsize/*" />
FUNCTION FSize() AS DWORD
    RETURN XSharp.FileSearch.FSize()

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/ftime/*" />
FUNCTION FTime() AS STRING
    RETURN XSharp.FileSearch.FTime()

// Worker function with normal file search worker
INTERNAL FUNCTION FileSearchWorker(cFile AS STRING) AS STRING
    LOCAL lFirst AS LOGIC
    IF System.IO.File.Exists(cFile)
        RETURN Path.GetFullPath( cFile )
    ENDIF
    LOCAL aPaths AS STRING[]
    aPaths := __GetSearchPaths()
    lFirst := TRUE
    FOREACH cPath AS STRING IN aPaths
        VAR cTemp := System.IO.Path.Combine(cPath, cFile)
        IF lFirst
            // store the first path that we looked in even when the file is not found
            // to be compatible with VO
            RuntimeState.LastFound := cTemp
            lFirst := FALSE
        ENDIF
        IF System.IO.File.Exists(cTemp)
            RuntimeState.LastFound := cTemp
            RETURN cTemp
        ENDIF
    NEXT
    RETURN ""

    /// <summary>
    /// Register Worker function for File Search API.
    /// </summary>
    /// <param name="newWorker">Function that implements the worker. Must implement the FileSearcher delegate, so take STRING parameter and return a STRING</param>
    /// <returns>
    /// current Worker function
    /// </returns>
    /// <seealso cref="T:XSharp.FileSearcher">FileSearcher Delegate </seealso>
FUNCTION RegisterFileSearch(newWorker AS FileSearcher) AS FileSearcher
    LOCAL oldWorker AS FileSearcher
    oldWorker := XSharp.FileSearch.Worker
    IF newWorker != NULL
        XSharp.FileSearch.Worker := newWorker
    ENDIF
    RETURN oldWorker

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/file/*" />
FUNCTION File(cFileSpec AS STRING) AS LOGIC
    LOCAL lHasWildCards AS LOGIC
    LOCAL aPaths AS STRING[]
    LOCAL lFirst AS LOGIC
    TRY
        cFileSpec := cFileSpec?:Trim()
        IF String.IsNullOrEmpty(cFileSpec)
            RETURN FALSE
        ENDIF
        lHasWildCards := cFileSpec:IndexOfAny( <CHAR>{ '*', '?' } ) > 0
        RuntimeState.LastFound := ""
        IF ! lHasWildCards
            VAR cFound := XSharp.FileSearch.Worker(cFileSpec)
            IF ! String.IsNullOrEmpty(cFound)
                RuntimeState.LastFound := cFound
                RETURN TRUE
            ENDIF
        ELSE
            // wildcard, so use Directory.GetFiles()
            LOCAL files     AS STRING[]

            IF Path.IsPathRooted(cFileSpec)
                files := Directory.GetFiles( Path.GetDirectoryName( cFileSpec ), Path.GetFileName( cFileSpec ) )
                IF files:Length > 0
                    RuntimeState.LastFound := files[1]
                    RETURN TRUE
                ELSE
                    // store the first path that we looked in even when the file is not found
                    // to be compatible with VO
                    RuntimeState.LastFound := cFileSpec
                    RETURN FALSE
                ENDIF
            ELSE
                // Look in current directory first and if that fails through the whole normal search list
                IF __FileHelper(Environment.CurrentDirectory, cFileSpec, FALSE )
                    RETURN TRUE
                ENDIF
                aPaths := __GetSearchPaths()
                lFirst := TRUE
                FOREACH cPath AS STRING IN aPaths
                    IF __FileHelper(cPath, cFileSpec, lFirst )
                        RETURN TRUE
                    ENDIF
                    lFirst := FALSE
                NEXT
            ENDIF
        ENDIF
    CATCH e as Exception
        XSharp.IO.File.SetErrorState(e)
    END TRY
    RETURN FALSE

/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/FPathName/*" />
FUNCTION FPathName() AS STRING
    RETURN RuntimeState.LastFound

INTERNAL FUNCTION __FileHelper(cPath AS STRING, cFileSpec AS STRING, lSavePath AS LOGIC) AS LOGIC
    LOCAL cTemp AS STRING
    LOCAL cFile AS STRING
    LOCAL files AS STRING[]
    IF ! System.IO.Directory.Exists(cPath)
        RETURN FALSE
    ENDIF
    cTemp := System.IO.Path.Combine(cPath, cFileSpec)
    cPath := System.IO.Path.GetDirectoryName(cTemp)
    cFile := System.IO.Path.GetFileName(cTemp)
    IF ! System.IO.Directory.Exists(cPath)
        RETURN FALSE
    ENDIF
    files := System.IO.Directory.GetFiles(cPath, cFile)
    IF files:Length > 0
        RuntimeState.LastFound := files[0]
    ELSEIF lSavePath
        RuntimeState.LastFound := cTemp
    ENDIF
    RETURN files:Length > 0

INTERNAL FUNCTION __GetSearchPaths() AS STRING[]
// Not found, now use the path settings from SetDefault and SetPath()
// if SetPath() is empty then we look through the Environment variable Path
LOCAL aDefault AS STRING[]
aDefault := SetPathArray()
IF aDefault != NULL
    RETURN aDefault
ENDIF

VAR aPaths := List<STRING>{}
VAR cPath  := SetDefault()
IF !String.IsNullOrEmpty(cPath)
    aPaths:Add(cPath)
ENDIF
cPath := SetPath()
IF String.IsNullOrEmpty(cPath)
    cPath := GetEnv("PATH")
ENDIF
IF !String.IsNullOrEmpty(cPath)
    VAR aElements := cPath:Split(<CHAR>{ ';' }, StringSplitOptions.RemoveEmptyEntries )
    aPaths:AddRange(aElements)
ENDIF
aDefault := aPaths:ToArray()
SetPathArray(aDefault)
RETURN aDefault


source/QtLocation: updated

source/QtLocation: updated

Modified:
source/QtLocation/QGeoRouteRequest.prg

/*

  Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5

  Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QGEOCOORDINATE
REQUEST QGEORECTANGLE
#endif

CLASS QGeoRouteRequest

   DATA pointer
   DATA self_destruction INIT .F.

   METHOD new
   METHOD delete
   METHOD setWaypoints
   METHOD waypoints
   METHOD setExcludeAreas
   METHOD excludeAreas
   METHOD setNumberAlternativeRoutes
   METHOD numberAlternativeRoutes
   METHOD setTravelModes
   METHOD travelModes
   METHOD setFeatureWeight
   METHOD featureWeight
   METHOD featureTypes
   METHOD setRouteOptimization
   METHOD routeOptimization
   METHOD setSegmentDetail
   METHOD segmentDetail
   METHOD setManeuverDetail
   METHOD maneuverDetail

   METHOD newFrom
   METHOD newFromObject
   METHOD newFromPointer
   METHOD selfDestruction
   METHOD setSelfDestruction

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject() CLASS QGeoRouteRequest
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <QtCore/Qt>

#ifndef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
#include <QtLocation/QGeoRouteRequest>
#endif
#endif

#include "qt5xhb_common.h"
#include "qt5xhb_macros.h"
#include "qt5xhb_utils.h"

#ifdef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
#include <QtLocation/QGeoRouteRequest>
#endif
#endif

#include <QtPositioning/QGeoRectangle>

/*
explicit QGeoRouteRequest(const QList<QGeoCoordinate> &waypoints = QList<QGeoCoordinate>())
*/
void QGeoRouteRequest_new1 ()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QList<QGeoCoordinate> par1;
  PHB_ITEM aList1 = hb_param(1, HB_IT_ARRAY);
  int i1;
  int nLen1 = hb_arrayLen(aList1);
  for (i1=0;i1<nLen1;i1++)
  {
    par1 << *(QGeoCoordinate *) hb_itemGetPtr( hb_objSendMsg( hb_arrayGetItemPtr( aList1, i1+1 ), "POINTER", 0 ) );
  }
  QGeoRouteRequest * o = new QGeoRouteRequest ( par1 );
  Qt5xHb::returnNewObject( o, true );
#endif
}

/*
QGeoRouteRequest(const QGeoCoordinate &origin, const QGeoCoordinate &destination)
*/
void QGeoRouteRequest_new2()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * o = new QGeoRouteRequest( *PQGEOCOORDINATE(1), *PQGEOCOORDINATE(2) );
  Qt5xHb::returnNewObject( o, true );
#endif
}

/*
QGeoRouteRequest(const QGeoRouteRequest &other)
*/
void QGeoRouteRequest_new3()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * o = new QGeoRouteRequest( *PQGEOROUTEREQUEST(1) );
  Qt5xHb::returnNewObject( o, true );
#endif
}

//[1]explicit QGeoRouteRequest(const QList<QGeoCoordinate> &waypoints = QList<QGeoCoordinate>())
//[2]QGeoRouteRequest(const QGeoCoordinate &origin, const QGeoCoordinate &destination)
//[3]QGeoRouteRequest(const QGeoRouteRequest &other)

HB_FUNC_STATIC( QGEOROUTEREQUEST_NEW )
{
  if( ISBETWEEN(0,1) && (ISARRAY(1)||ISNIL(1)) )
  {
    QGeoRouteRequest_new1();
  }
  else if( ISNUMPAR(2) && ISQGEOCOORDINATE(1) && ISQGEOCOORDINATE(2) )
  {
    QGeoRouteRequest_new2();
  }
  else if( ISNUMPAR(1) && ISQGEOROUTEREQUEST(1) )
  {
    QGeoRouteRequest_new3();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QGEOROUTEREQUEST_DELETE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void setWaypoints(const QList<QGeoCoordinate> &waypoints)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETWAYPOINTS )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISARRAY(1) )
    {
#endif
      QList<QGeoCoordinate> par1;
      PHB_ITEM aList1 = hb_param(1, HB_IT_ARRAY);
      int i1;
      int nLen1 = hb_arrayLen(aList1);
      for (i1=0;i1<nLen1;i1++)
      {
        par1 << *(QGeoCoordinate *) hb_itemGetPtr( hb_objSendMsg( hb_arrayGetItemPtr( aList1, i1+1 ), "POINTER", 0 ) );
      }
      obj->setWaypoints( par1 );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
QList<QGeoCoordinate> waypoints() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_WAYPOINTS )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QList<QGeoCoordinate> list = obj->waypoints();
      PHB_DYNS pDynSym = hb_dynsymFindName( "QGEOCOORDINATE" );
      PHB_ITEM pArray = hb_itemArrayNew(0);
      if( pDynSym )
      {
        for( int i = 0; i < list.count(); i++ )
        {
          hb_vmPushDynSym( pDynSym );
          hb_vmPushNil();
          hb_vmDo( 0 );
          PHB_ITEM pObject = hb_itemNew( NULL );
          hb_itemCopy( pObject, hb_stackReturnItem() );
          PHB_ITEM pItem = hb_itemNew( NULL );
          hb_itemPutPtr( pItem, (QGeoCoordinate *) new QGeoCoordinate( list[i] ) );
          hb_objSendMsg( pObject, "_POINTER", 1, pItem );
          hb_itemRelease( pItem );
          PHB_ITEM pDestroy = hb_itemNew( NULL );
          hb_itemPutL( pDestroy, true );
          hb_objSendMsg( pObject, "_SELF_DESTRUCTION", 1, pDestroy );
          hb_itemRelease( pDestroy );
          hb_arrayAddForward( pArray, pObject );
          hb_itemRelease( pObject );
        }
      }
      else
      {
        hb_errRT_BASE( EG_NOFUNC, 1001, NULL, "QGEOCOORDINATE", HB_ERR_ARGS_BASEPARAMS );
      }
      hb_itemReturnRelease(pArray);
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setExcludeAreas(const QList<QGeoRectangle> &areas)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETEXCLUDEAREAS )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISARRAY(1) )
    {
#endif
      QList<QGeoRectangle> par1;
      PHB_ITEM aList1 = hb_param(1, HB_IT_ARRAY);
      int i1;
      int nLen1 = hb_arrayLen(aList1);
      for (i1=0;i1<nLen1;i1++)
      {
        par1 << *(QGeoRectangle *) hb_itemGetPtr( hb_objSendMsg( hb_arrayGetItemPtr( aList1, i1+1 ), "POINTER", 0 ) );
      }
      obj->setExcludeAreas( par1 );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
QList<QGeoRectangle> excludeAreas() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_EXCLUDEAREAS )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QList<QGeoRectangle> list = obj->excludeAreas();
      PHB_DYNS pDynSym = hb_dynsymFindName( "QGEORECTANGLE" );
      PHB_ITEM pArray = hb_itemArrayNew(0);
      if( pDynSym )
      {
        for( int i = 0; i < list.count(); i++ )
        {
          hb_vmPushDynSym( pDynSym );
          hb_vmPushNil();
          hb_vmDo( 0 );
          PHB_ITEM pObject = hb_itemNew( NULL );
          hb_itemCopy( pObject, hb_stackReturnItem() );
          PHB_ITEM pItem = hb_itemNew( NULL );
          hb_itemPutPtr( pItem, (QGeoRectangle *) new QGeoRectangle( list[i] ) );
          hb_objSendMsg( pObject, "_POINTER", 1, pItem );
          hb_itemRelease( pItem );
          PHB_ITEM pDestroy = hb_itemNew( NULL );
          hb_itemPutL( pDestroy, true );
          hb_objSendMsg( pObject, "_SELF_DESTRUCTION", 1, pDestroy );
          hb_itemRelease( pDestroy );
          hb_arrayAddForward( pArray, pObject );
          hb_itemRelease( pObject );
        }
      }
      else
      {
        hb_errRT_BASE( EG_NOFUNC, 1001, NULL, "QGEORECTANGLE", HB_ERR_ARGS_BASEPARAMS );
      }
      hb_itemReturnRelease(pArray);
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setNumberAlternativeRoutes(int alternatives)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETNUMBERALTERNATIVEROUTES )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->setNumberAlternativeRoutes( PINT(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
int numberAlternativeRoutes() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_NUMBERALTERNATIVEROUTES )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RINT( obj->numberAlternativeRoutes() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setTravelModes(TravelModes travelModes)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETTRAVELMODES )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->setTravelModes( (QGeoRouteRequest::TravelModes) hb_parni(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
TravelModes travelModes() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_TRAVELMODES )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RENUM( obj->travelModes() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setFeatureWeight(FeatureType featureType, FeatureWeight featureWeight)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETFEATUREWEIGHT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(2) && ISNUM(1) && ISNUM(2) )
    {
#endif
      obj->setFeatureWeight( (QGeoRouteRequest::FeatureType) hb_parni(1), (QGeoRouteRequest::FeatureWeight) hb_parni(2) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
FeatureWeight featureWeight(FeatureType featureType) const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_FEATUREWEIGHT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      RENUM( obj->featureWeight( (QGeoRouteRequest::FeatureType) hb_parni(1) ) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
QList<FeatureType> featureTypes() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_FEATURETYPES )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QList<QGeoRouteRequest::FeatureType> list = obj->featureTypes();
      PHB_ITEM pArray = hb_itemArrayNew(0);
      for( int i = 0; i < list.count(); i++ )
      {
        PHB_ITEM pItem = hb_itemPutNI( NULL, (int) list[i] );
        hb_arrayAddForward( pArray, pItem );
        hb_itemRelease(pItem);
      }
      hb_itemReturnRelease(pArray);
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setRouteOptimization(RouteOptimizations optimization)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETROUTEOPTIMIZATION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->setRouteOptimization( (QGeoRouteRequest::RouteOptimizations) hb_parni(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
RouteOptimizations routeOptimization() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_ROUTEOPTIMIZATION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RENUM( obj->routeOptimization() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setSegmentDetail(SegmentDetail segmentDetail)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETSEGMENTDETAIL )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->setSegmentDetail( (QGeoRouteRequest::SegmentDetail) hb_parni(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
SegmentDetail segmentDetail() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SEGMENTDETAIL )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RENUM( obj->segmentDetail() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setManeuverDetail(ManeuverDetail maneuverDetail)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETMANEUVERDETAIL )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->setManeuverDetail( (QGeoRouteRequest::ManeuverDetail) hb_parni(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
ManeuverDetail maneuverDetail() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_MANEUVERDETAIL )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RENUM( obj->maneuverDetail() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

HB_FUNC_STATIC( QGEOROUTEREQUEST_NEWFROM )
{
  PHB_ITEM self = hb_stackSelfItem();

  if( hb_pcount() == 1 && ISOBJECT(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else if( hb_pcount() == 1 && ISPOINTER(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_param(1, HB_IT_POINTER ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }

  hb_itemReturn( self );
}

HB_FUNC_STATIC( QGEOROUTEREQUEST_NEWFROMOBJECT )
{
  HB_FUNC_EXEC( QGEOROUTEREQUEST_NEWFROM );
}

HB_FUNC_STATIC( QGEOROUTEREQUEST_NEWFROMPOINTER )
{
  HB_FUNC_EXEC( QGEOROUTEREQUEST_NEWFROM );
}

HB_FUNC_STATIC( QGEOROUTEREQUEST_SELFDESTRUCTION )
{
  hb_retl( (bool) hb_itemGetL( hb_objSendMsg( hb_stackSelfItem(), "SELF_DESTRUCTION", 0 ) ) );
}

HB_FUNC_STATIC( QGEOROUTEREQUEST_SETSELFDESTRUCTION )
{
  PHB_ITEM self = hb_stackSelfItem();

  if( hb_pcount() == 1 && ISLOG(1) )
  {
    PHB_ITEM des = hb_itemPutL( NULL, hb_parl(1) );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }

  hb_itemReturn( self );
}

#pragma ENDDUMP

/*

  Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5

  Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com>

*/

/*
  DO NOT EDIT THIS FILE - the content was created using a source code generator
*/

#include "hbclass.ch"

#ifndef QT5XHB_NO_REQUESTS
REQUEST QGEOCOORDINATE
REQUEST QGEORECTANGLE
#endif

CLASS QGeoRouteRequest

   DATA pointer
   DATA self_destruction INIT .F.

   METHOD new
   METHOD delete
   METHOD setWaypoints
   METHOD waypoints
   METHOD setExcludeAreas
   METHOD excludeAreas
   METHOD setNumberAlternativeRoutes
   METHOD numberAlternativeRoutes
   METHOD setTravelModes
   METHOD travelModes
   METHOD setFeatureWeight
   METHOD featureWeight
   METHOD featureTypes
   METHOD setRouteOptimization
   METHOD routeOptimization
   METHOD setSegmentDetail
   METHOD segmentDetail
   METHOD setManeuverDetail
   METHOD maneuverDetail

   METHOD newFrom
   METHOD newFromObject
   METHOD newFromPointer
   METHOD selfDestruction
   METHOD setSelfDestruction

   DESTRUCTOR destroyObject

END CLASS

PROCEDURE destroyObject() CLASS QGeoRouteRequest
   IF ::self_destruction
      ::delete()
   ENDIF
RETURN

#pragma BEGINDUMP

#include <QtCore/Qt>

#ifndef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
#include <QtLocation/QGeoRouteRequest>
#endif
#endif

#include "qt5xhb_common.h"
#include "qt5xhb_macros.h"
#include "qt5xhb_utils.h"

#ifdef __XHARBOUR__
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
#include <QtLocation/QGeoRouteRequest>
#endif
#endif

#include <QtPositioning/QGeoRectangle>

/*
explicit QGeoRouteRequest(const QList<QGeoCoordinate> &waypoints = QList<QGeoCoordinate>())
*/
void QGeoRouteRequest_new1 ()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QList<QGeoCoordinate> par1;
  PHB_ITEM aList1 = hb_param(1, HB_IT_ARRAY);
  int i1;
  int nLen1 = hb_arrayLen(aList1);
  for (i1=0;i1<nLen1;i1++)
  {
    par1 << *(QGeoCoordinate *) hb_itemGetPtr( hb_objSendMsg( hb_arrayGetItemPtr( aList1, i1+1 ), "POINTER", 0 ) );
  }
  QGeoRouteRequest * o = new QGeoRouteRequest ( par1 );
  _qt5xhb_returnNewObject( o, true );
#endif
}

/*
QGeoRouteRequest(const QGeoCoordinate &origin, const QGeoCoordinate &destination)
*/
void QGeoRouteRequest_new2()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * o = new QGeoRouteRequest( *PQGEOCOORDINATE(1), *PQGEOCOORDINATE(2) );
  Qt5xHb::returnNewObject( o, true );
#endif
}

/*
QGeoRouteRequest(const QGeoRouteRequest &other)
*/
void QGeoRouteRequest_new3()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * o = new QGeoRouteRequest( *PQGEOROUTEREQUEST(1) );
  Qt5xHb::returnNewObject( o, true );
#endif
}

//[1]explicit QGeoRouteRequest(const QList<QGeoCoordinate> &waypoints = QList<QGeoCoordinate>())
//[2]QGeoRouteRequest(const QGeoCoordinate &origin, const QGeoCoordinate &destination)
//[3]QGeoRouteRequest(const QGeoRouteRequest &other)

HB_FUNC_STATIC( QGEOROUTEREQUEST_NEW )
{
  if( ISBETWEEN(0,1) && (ISARRAY(1)||ISNIL(1)) )
  {
    QGeoRouteRequest_new1();
  }
  else if( ISNUMPAR(2) && ISQGEOCOORDINATE(1) && ISQGEOCOORDINATE(2) )
  {
    QGeoRouteRequest_new2();
  }
  else if( ISNUMPAR(1) && ISQGEOROUTEREQUEST(1) )
  {
    QGeoRouteRequest_new3();
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }
}

HB_FUNC_STATIC( QGEOROUTEREQUEST_DELETE )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
    delete obj;
    obj = NULL;
    PHB_ITEM self = hb_stackSelfItem();
    PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
void setWaypoints(const QList<QGeoCoordinate> &waypoints)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETWAYPOINTS )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISARRAY(1) )
    {
#endif
      QList<QGeoCoordinate> par1;
      PHB_ITEM aList1 = hb_param(1, HB_IT_ARRAY);
      int i1;
      int nLen1 = hb_arrayLen(aList1);
      for (i1=0;i1<nLen1;i1++)
      {
        par1 << *(QGeoCoordinate *) hb_itemGetPtr( hb_objSendMsg( hb_arrayGetItemPtr( aList1, i1+1 ), "POINTER", 0 ) );
      }
      obj->setWaypoints( par1 );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
QList<QGeoCoordinate> waypoints() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_WAYPOINTS )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QList<QGeoCoordinate> list = obj->waypoints();
      PHB_DYNS pDynSym = hb_dynsymFindName( "QGEOCOORDINATE" );
      PHB_ITEM pArray = hb_itemArrayNew(0);
      if( pDynSym )
      {
        for( int i = 0; i < list.count(); i++ )
        {
          hb_vmPushDynSym( pDynSym );
          hb_vmPushNil();
          hb_vmDo( 0 );
          PHB_ITEM pObject = hb_itemNew( NULL );
          hb_itemCopy( pObject, hb_stackReturnItem() );
          PHB_ITEM pItem = hb_itemNew( NULL );
          hb_itemPutPtr( pItem, (QGeoCoordinate *) new QGeoCoordinate( list[i] ) );
          hb_objSendMsg( pObject, "_POINTER", 1, pItem );
          hb_itemRelease( pItem );
          PHB_ITEM pDestroy = hb_itemNew( NULL );
          hb_itemPutL( pDestroy, true );
          hb_objSendMsg( pObject, "_SELF_DESTRUCTION", 1, pDestroy );
          hb_itemRelease( pDestroy );
          hb_arrayAddForward( pArray, pObject );
          hb_itemRelease( pObject );
        }
      }
      else
      {
        hb_errRT_BASE( EG_NOFUNC, 1001, NULL, "QGEOCOORDINATE", HB_ERR_ARGS_BASEPARAMS );
      }
      hb_itemReturnRelease(pArray);
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setExcludeAreas(const QList<QGeoRectangle> &areas)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETEXCLUDEAREAS )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISARRAY(1) )
    {
#endif
      QList<QGeoRectangle> par1;
      PHB_ITEM aList1 = hb_param(1, HB_IT_ARRAY);
      int i1;
      int nLen1 = hb_arrayLen(aList1);
      for (i1=0;i1<nLen1;i1++)
      {
        par1 << *(QGeoRectangle *) hb_itemGetPtr( hb_objSendMsg( hb_arrayGetItemPtr( aList1, i1+1 ), "POINTER", 0 ) );
      }
      obj->setExcludeAreas( par1 );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
QList<QGeoRectangle> excludeAreas() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_EXCLUDEAREAS )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QList<QGeoRectangle> list = obj->excludeAreas();
      PHB_DYNS pDynSym = hb_dynsymFindName( "QGEORECTANGLE" );
      PHB_ITEM pArray = hb_itemArrayNew(0);
      if( pDynSym )
      {
        for( int i = 0; i < list.count(); i++ )
        {
          hb_vmPushDynSym( pDynSym );
          hb_vmPushNil();
          hb_vmDo( 0 );
          PHB_ITEM pObject = hb_itemNew( NULL );
          hb_itemCopy( pObject, hb_stackReturnItem() );
          PHB_ITEM pItem = hb_itemNew( NULL );
          hb_itemPutPtr( pItem, (QGeoRectangle *) new QGeoRectangle( list[i] ) );
          hb_objSendMsg( pObject, "_POINTER", 1, pItem );
          hb_itemRelease( pItem );
          PHB_ITEM pDestroy = hb_itemNew( NULL );
          hb_itemPutL( pDestroy, true );
          hb_objSendMsg( pObject, "_SELF_DESTRUCTION", 1, pDestroy );
          hb_itemRelease( pDestroy );
          hb_arrayAddForward( pArray, pObject );
          hb_itemRelease( pObject );
        }
      }
      else
      {
        hb_errRT_BASE( EG_NOFUNC, 1001, NULL, "QGEORECTANGLE", HB_ERR_ARGS_BASEPARAMS );
      }
      hb_itemReturnRelease(pArray);
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setNumberAlternativeRoutes(int alternatives)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETNUMBERALTERNATIVEROUTES )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->setNumberAlternativeRoutes( PINT(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
int numberAlternativeRoutes() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_NUMBERALTERNATIVEROUTES )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RINT( obj->numberAlternativeRoutes() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setTravelModes(TravelModes travelModes)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETTRAVELMODES )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->setTravelModes( (QGeoRouteRequest::TravelModes) hb_parni(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
TravelModes travelModes() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_TRAVELMODES )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RENUM( obj->travelModes() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setFeatureWeight(FeatureType featureType, FeatureWeight featureWeight)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETFEATUREWEIGHT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(2) && ISNUM(1) && ISNUM(2) )
    {
#endif
      obj->setFeatureWeight( (QGeoRouteRequest::FeatureType) hb_parni(1), (QGeoRouteRequest::FeatureWeight) hb_parni(2) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
FeatureWeight featureWeight(FeatureType featureType) const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_FEATUREWEIGHT )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      RENUM( obj->featureWeight( (QGeoRouteRequest::FeatureType) hb_parni(1) ) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
QList<FeatureType> featureTypes() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_FEATURETYPES )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      QList<QGeoRouteRequest::FeatureType> list = obj->featureTypes();
      PHB_ITEM pArray = hb_itemArrayNew(0);
      for( int i = 0; i < list.count(); i++ )
      {
        PHB_ITEM pItem = hb_itemPutNI( NULL, (int) list[i] );
        hb_arrayAddForward( pArray, pItem );
        hb_itemRelease(pItem);
      }
      hb_itemReturnRelease(pArray);
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setRouteOptimization(RouteOptimizations optimization)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETROUTEOPTIMIZATION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->setRouteOptimization( (QGeoRouteRequest::RouteOptimizations) hb_parni(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
RouteOptimizations routeOptimization() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_ROUTEOPTIMIZATION )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RENUM( obj->routeOptimization() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setSegmentDetail(SegmentDetail segmentDetail)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETSEGMENTDETAIL )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->setSegmentDetail( (QGeoRouteRequest::SegmentDetail) hb_parni(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
SegmentDetail segmentDetail() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SEGMENTDETAIL )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RENUM( obj->segmentDetail() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

/*
void setManeuverDetail(ManeuverDetail maneuverDetail)
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_SETMANEUVERDETAIL )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(1) && ISNUM(1) )
    {
#endif
      obj->setManeuverDetail( (QGeoRouteRequest::ManeuverDetail) hb_parni(1) );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }

  hb_itemReturn( hb_stackSelfItem() );
#endif
}

/*
ManeuverDetail maneuverDetail() const
*/
HB_FUNC_STATIC( QGEOROUTEREQUEST_MANEUVERDETAIL )
{
#if (QT_VERSION >= QT_VERSION_CHECK(5,4,0))
  QGeoRouteRequest * obj = (QGeoRouteRequest *) Qt5xHb::itemGetPtrStackSelfItem();

  if( obj )
  {
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    if( ISNUMPAR(0) )
    {
#endif
      RENUM( obj->maneuverDetail() );
#ifndef QT5XHB_DONT_CHECK_PARAMETERS
    }
    else
    {
      hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
    }
#endif
  }
#endif
}

HB_FUNC_STATIC( QGEOROUTEREQUEST_NEWFROM )
{
  PHB_ITEM self = hb_stackSelfItem();

  if( hb_pcount() == 1 && ISOBJECT(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else if( hb_pcount() == 1 && ISPOINTER(1) )
  {
    PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_param(1, HB_IT_POINTER ) ) );
    hb_objSendMsg( self, "_pointer", 1, ptr );
    hb_itemRelease( ptr );
    PHB_ITEM des = hb_itemPutL( NULL, false );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }

  hb_itemReturn( self );
}

HB_FUNC_STATIC( QGEOROUTEREQUEST_NEWFROMOBJECT )
{
  HB_FUNC_EXEC( QGEOROUTEREQUEST_NEWFROM );
}

HB_FUNC_STATIC( QGEOROUTEREQUEST_NEWFROMPOINTER )
{
  HB_FUNC_EXEC( QGEOROUTEREQUEST_NEWFROM );
}

HB_FUNC_STATIC( QGEOROUTEREQUEST_SELFDESTRUCTION )
{
  hb_retl( (bool) hb_itemGetL( hb_objSendMsg( hb_stackSelfItem(), "SELF_DESTRUCTION", 0 ) ) );
}

HB_FUNC_STATIC( QGEOROUTEREQUEST_SETSELFDESTRUCTION )
{
  PHB_ITEM self = hb_stackSelfItem();

  if( hb_pcount() == 1 && ISLOG(1) )
  {
    PHB_ITEM des = hb_itemPutL( NULL, hb_parl(1) );
    hb_objSendMsg( self, "_self_destruction", 1, des );
    hb_itemRelease( des );
  }
  else
  {
    hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
  }

  hb_itemReturn( self );
}

#pragma ENDDUMP