// $Source: /usr/local/SimSoft/SoftShop/Basics/io/FileSys.h,v $
// $Revision: 1.14 $
// $Author: baum $
// $Date: 2001/11/29 15:52:23 $
//
// Login name of the user who locked the revision
// $Locker:  $
// Tag name used to checkout the file
// $Name: Release-20 $
// State assigned to revision
// $State: Exp $
//
//
// $Log: FileSys.h,v $
// Revision 1.14  2001/11/29 15:52:23  baum
// -In Kalender.cpp und Kalender.h Handsteuerung eingebaut
//


#ifndef _FILESYSTEM_H
#define _FILESYSTEM_H


#ifdef _FILESYSTEM_CPP
#  undef _impexp
#  define _impexp __declspec(dllexport)
#elif defined BUILD_BASICS_DLL
#  undef _impexp
#  define _impexp __declspec(dllexport)
#else
#  undef _impexp
#  define _impexp __declspec(dllimport)
#endif

#if defined __GNUG__ || defined __hpux
#  undef _impexp
#  define _impexp
#endif


// a class-utility for interaction with the file-system
//##ModelId=3FBCBCC603B9
class _impexp FileSystem
  {
  public:
    // the separation char used in paths ('/' or '\')
	//##ModelId=3FBCBCC603C8
    static const char PathSeparator ();

    // (these emit Warnings only if verbose == true)
	//##ModelId=3FBCBCC603CA
    static const char* CurrentDir (                  bool verbose = true);
	//##ModelId=3FBCBCC603CD
    static bool        changeDir  (const char* path, bool verbose = true);
	//##ModelId=3FBCBCC603DB
    static bool        makeDir    (const char* name, bool verbose = true);

    // returns newly allocated char*, deletion is caller's responsibility
	//##ModelId=3FBCBCC603DF
    static char* createPathForOS (const char* path);

    // returns given char* with the OD-PathSeparator
	//##ModelId=3FBCBCC70002
    static char* switchPathForOS (char* path);

    // returns Path from where the executable image was loaded
	//##ModelId=3FBCBCC70005
    static const char* ExePath ();

    // returns full Pathname
    // (directories are searched in the following order:
    //  current Dir, ExePath, anything in "PATH"-environment-variable
	//##ModelId=3FBCBCC70010
    static const char* FullPathName (const char* fileName);

    // returns true if the file with the given name can be opened, else false
	//##ModelId=3FBCBCC70013
    static bool FileExists (const char* nameAndPath);

    // returns true if the Dir exists, else false
	//##ModelId=3FBCBCC70016
    static bool DirExists (const char* Path);
    // setting/cleaning things up
	//##ModelId=3FBCBCC70021
    static void setup ();
	//##ModelId=3FBCBCC70023
    static void cleanup ();
	//##ModelId=3FBCBCC70025
    static bool isInitialized ();

  protected:

  private:
    // default constructor, declared but not defined
	//##ModelId=3FBCBCC7002F
    FileSystem ();

    // copy constructor, declared but not defined
	//##ModelId=3FBCBCC70030
    FileSystem (const FileSystem&);

    // assignment operator, declared but not defined
	//##ModelId=3FBCBCC70032
    FileSystem& operator = (const FileSystem&);

    // destructor, declared but not defined
	//##ModelId=3FBCBCC7003F
    ~FileSystem ();

    // a helper function
	//##ModelId=3FBCBCC70040
    static bool setPath (const char* path, bool verbose);

    // static data
	//##ModelId=3FBCBCC7004E
    static char  ClassPathSep;
	//##ModelId=3FBCBCC7004F
    static char* ClassStartPath;
	//##ModelId=3FBCBCC70050
    static bool  ClassIsInitialized;

  // friends
    friend class ProgArgs;
}; // class FileSystem


#endif	// !defined _FILESYSTEM_H

//	$Filename: C:\Software\SoftShop\Basics\io\FileSys.h $	ends
