version 1.2, 2001/02/11 05:42:33
|
version 1.9, 2001/05/06 13:16:16
|
|
|
//BEGIN_LICENSE |
//%///////////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM | // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM |
// | // |
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
// DEALINGS IN THE SOFTWARE. | // DEALINGS IN THE SOFTWARE. |
// | // |
//END_LICENSE |
//============================================================================== |
//BEGIN_HISTORY |
|
// | // |
// Author: |
// Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// $Log$ |
// Modified By: |
// Revision 1.2 2001/02/11 05:42:33 mike |
|
// new |
|
// | // |
// Revision 1.1.1.1 2001/01/14 19:51:36 mike |
//%///////////////////////////////////////////////////////////////////////////// |
// Pegasus import |
|
// |
|
// |
|
//END_HISTORY |
|
| |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
// | // |
|
|
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/String.h> | #include <Pegasus/Common/String.h> |
|
#include <Pegasus/Common/Array.h> |
#include <Pegasus/Common/Exception.h> | #include <Pegasus/Common/Exception.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
|
|
| |
static Boolean getFileSize(const String& path, Uint32& size); | static Boolean getFileSize(const String& path, Uint32& size); |
| |
// Remove the given directory: |
/** Get the current working Directory. */ |
|
static Boolean getCurrentDirectory(String& path); |
| |
|
/** Remove the given directory. The directory must be empty |
|
to be eligible for removal |
|
@param String path is the relative or ablsolute path to |
|
the directory to remove |
|
@return true if directory removed |
|
*/ |
static Boolean removeDirectory(const String& path); | static Boolean removeDirectory(const String& path); |
| |
// Remove the given file: |
/** Remove a directory hiearchy. Removes a complete hiearchy of |
|
directories and files. |
| |
|
WARNING: This differs significantly from the <TT>removeDirectory</TT> |
|
function in that it removes both directories and files and |
|
removes a complete hiearchy. Use with caution. |
|
@param path defines the high level directory to be removed |
|
@return Boolean True if successful |
|
@exception - ATTN: Not sure if there is any exception |
|
*/ |
|
static Boolean removeDirectoryHier(const String& path); |
|
|
|
/** Remove the file defined by the input parameter |
|
@param path of file to remove |
|
@return Boolean true if directory removed |
|
*/ |
static Boolean removeFile(const String& path); | static Boolean removeFile(const String& path); |
| |
// Get the names of the files (and directories) in the given directory: |
/** Get the names of the files (and directories) in the given directory: |
| |
|
@param path - the path of the directory from which we will get filenames |
|
@param paths - On return, this Array contains the names of the files |
|
in the directory |
|
ATTN: Is this local names or fully qualified names with paths. |
|
@return Boolean that is today only true. |
|
@exception Throws "NoSuchDirectory" if the directory defined in path does |
|
not exist. |
|
*/ |
static Boolean getDirectoryContents( | static Boolean getDirectoryContents( |
const String& path, | const String& path, |
Array<String>& paths); | Array<String>& paths); |
| |
// Load the contents of the file into the array. Throws CannotOpenFile if |
/** Load the contents of the file into the array. Throws CannotOpenFile if |
// unable to open file. |
unable to open file. |
|
*/ |
| |
static void loadFileToMemory( | static void loadFileToMemory( |
Array<Sint8>& array, | Array<Sint8>& array, |
const String& fileName); | const String& fileName); |
| |
// Return true if the two files are identical. Throws CannotOpenFile if |
/** Compare two file for content. |
// either file cannot be opened. |
@param filename of first file |
|
@param filename of second file |
|
ATTN: are filenames local or global??? |
|
@return Return true if the two files are identical. |
|
@exception Throws CannotOpenFile if either file cannot be opened. |
|
*/ |
static Boolean compare( | static Boolean compare( |
const String& fileName1, | const String& fileName1, |
const String& fileName2); | const String& fileName2); |
|
|
|
/** Rename the given file to the new name. */ |
|
static Boolean renameFile( |
|
const String& oldFileName, |
|
const String& newFileName); |
|
|
|
/** Translate backward slashes to forward slashes: */ |
|
static void translateSlashes(String& path); |
|
|
|
/** Returns true is the given directory is empty. */ |
|
static Boolean isDirectoryEmpty(const String& path); |
}; | }; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |