PlatformFuncs.h File Reference

These are functions which use platform-specific code. More...


Functions

bool TarballSetup (char *cAppPath)
 Verifies that gzip and tar are where we expect them to be (in the same directory as the executable).
void ZipFile (char *cFileName, char *cAppPath)
 Zips a file with GZIP.
void AddFileToTarball (char *cTarball, char *cFileToAdd, char *cAppPath)
 Adds a file to the end of a tarball.
void AddFileToNewTarball (char *cTarball, char *cFileToAdd, char *cAppPath)
 Creates a new tarball and adds a file to it.
void DeleteThisFile (char *cFile)
 Deletes a file.
bool DoesFileExist (char *cFile)
 Checks for the existence of a file.
void LaunchProcess (char *cFile, char *cArgs, char *cDir)
 Launches a process and waits for it to finish.


Detailed Description

These are functions which use platform-specific code.

Copyright 2003 Charles D. Canham.

Author:
Lora E. Murphy

Edit history:
-----------------
April 28, 2004 - Submitted as beta (LEM)

Function Documentation

void AddFileToNewTarball ( char *  cTarball,
char *  cFileToAdd,
char *  cAppPath 
)

Creates a new tarball and adds a file to it.

Any existing tarball of that name will be overwritten. If the tarball does not exist, it will be created. The file to add can be either zipped or not zipped.

Parameters:
cTarball File name of tarball
cFileToAdd File name of the file to add to the tarball
cAppPath Path to the main application, ending with the path separator. The TAR executable is expected to be in the same path.

void AddFileToTarball ( char *  cTarball,
char *  cFileToAdd,
char *  cAppPath 
)

Adds a file to the end of a tarball.

If the tarball does not exist, it will be created. The file to add can be either zipped or not zipped.

Parameters:
cTarball File name of tarball
cFileToAdd File name of the file to add to the tarball
cAppPath Path to the main application, ending with the path separator. The TAR executable is expected to be in the same path.

void DeleteThisFile ( char *  cFile  ) 

Deletes a file.

Parameters:
cFile File name of the file to delete

bool DoesFileExist ( char *  cFile  ) 

Checks for the existence of a file.

Parameters:
cFile File name of the file to check for existence
Returns:
True if the file exists, false if it doesn't

void LaunchProcess ( char *  cFile,
char *  cArgs,
char *  cDir 
)

Launches a process and waits for it to finish.

Parameters:
cFile Executable to launch
cArgs Arguments to pass to process
cDir Working directory

bool TarballSetup ( char *  cAppPath  ) 

Verifies that gzip and tar are where we expect them to be (in the same directory as the executable).

This should be called before either of the functions below and a fatal error thrown if it returns false.

Parameters:
cAppPath Path to the main application, ending with the path separator. The executables are expected to be in the same path.
Returns:
true if the executables are where they should be. Otherwise, false.

void ZipFile ( char *  cFileName,
char *  cAppPath 
)

Zips a file with GZIP.

If the file does not exist, the function does nothing.

Parameters:
cFileName File to zip.
cAppPath Path to the main application, ending with the path separator. The GZIP executable is expected to be in the same path.


Generated on Wed Nov 29 08:42:19 2006 for SORTIE Core C++ Documentation by  doxygen 1.4.7