************************************************************************
*FUNCTION wwcClient
*******************
***    Author: Rick Strahl
***            (c) West Wind Technologies, 1995-2023
***   Contact: www.west-wind.com - rstrahl@west-wind.com
***  Modified: 06/04/2020
***  Function: Main Program that loads all the Web Connect
***            classes into memory. This program is not required
***            for the registered version - simply use
***            SET PROCEDURE commands in your main program file.
************************************************************************
LPARAMETER lcUnload

lcUnload=IIF(VARTYPE(lcUnload)="C",UPPER(lcUnload),"LOAD")

#INCLUDE WCONNECT.H

*** Web Connection classes and PRGs are expected in a
*** CLASSES subdirectory or else in the current dir. Either
*** way they need to be accessible via the VFP PATH
*SET PATH TO  (WWC_FRAMEWORK_PATH + "CLASSES") ADDITIVE

*** Utility classes
DO wwUtils 
DO wwAPI 

DO wwEval
DO wwCollections
DO wwConfig

DO wwBusinessObject
DO wwSql
DO wwXml

DO wwHttp
DO wwFTP
DO wwSocket

DO wwScripting
DO wwRegEx
DO wwPdf

DO wwXmlState
DO wwXmlAdapter
DO wwCache


llDotnetBridgeLoaded = .T.
DO wwDotnetBridge
** wwDotnetBridge/.NET related
DO wwsmtp
DO wwJsonSerializer
DO wwJsonServiceClient
*DO wwJsonService    && Server releated
DO wwSftp
DO wwEncryption
DO MarkdownParser
DO wwDynamic

RETURN
*EOP wConnect


************************************************************************
FUNCTION Path
******************
***  Function: Adds or deletes items from the path string
***      Pass: pcPathName   -   Filename
***            pcMethod     -   *"ADD","DELETE"
***
***    Return: New Path or ""
************************************************************************
PARAMETERS pcPath,pcMethod
PRIVATE aPath,lcOldPath
pcMethod=IIF(type("pcMethod")="C",upper(pcMethod),"ADD")

IF parameters()<1 
   * WAIT WINDOW "No path passed..." NOWAIT
   RETURN
ENDIF
   
pcPath=ADDBS(LOWER(TRIM(pcPath)))
lcOldPath=LOWER(SET("PATH"))

IF pcMethod="ADD"
    IF EMPTY(pcPath) .OR. ;
       !Directory(pcPath)
      * WAIT WINDOW "Path does not exist..." NOWAIT
      RETURN ""
   ENDIF
   IF AT(";" + pcPath,";" + lcOldPath)>0
      * WAIT WINDOW "Path is already included..." NOWAIT
      RETURN ""
   ENDIF
   lcOldPath=lcOldPath+";"+pcPath
ELSE
   IF AT(";" + pcPath,";" + lcOldPath)<1
      * WAIT WINDOW "Path is not part of path string..." NOWAIT
      RETURN ""
   ENDIF
   lcOldPath=STRTRAN(lcOldPath,";"+pcPath)
   lcOldPath=STRTRAN(lcOldPath,pcPath)
ENDIF   

SET PATH TO &lcOldPath
* WAIT WINDOW NOWAIT "New Path: "+lcOldPath

RETURN lcOldPath
*EOP PATH
