version 1.29, 2002/03/12 19:41:19
|
version 1.34, 2002/06/01 00:56:31
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
|
// The Open Group, Tivoli Systems |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
return System::renameFile(p.getPointer(), q.getPointer()); | return System::renameFile(p.getPointer(), q.getPointer()); |
} | } |
| |
|
Boolean FileSystem::copyFile( |
|
const String& fromPath, |
|
const String& toPath) |
|
{ |
|
ArrayDestroyer<char> p(fromPath.allocateCString()); |
|
ArrayDestroyer<char> q(toPath.allocateCString()); |
|
return System::copyFile(p.getPointer(), q.getPointer()); |
|
} |
|
|
Boolean FileSystem::openNoCase(PEGASUS_STD(ifstream)& is, const String& path) | Boolean FileSystem::openNoCase(PEGASUS_STD(ifstream)& is, const String& path) |
{ | { |
String realPath; | String realPath; |
|
|
if (!existsNoCase(path, realPath)) | if (!existsNoCase(path, realPath)) |
return false; | return false; |
| |
ArrayDestroyer<char> p(_clonePath(path)); |
ArrayDestroyer<char> p(_clonePath(realPath)); |
| |
is.open(p.getPointer() PEGASUS_IOS_BINARY); | is.open(p.getPointer() PEGASUS_IOS_BINARY); |
|
return !!is; |
|
} |
| |
//not supported on Tru64 |
Boolean FileSystem::openNoCase( |
return is != 0; |
PEGASUS_STD(fstream)& fs, |
|
const String& path, |
|
int mode) |
|
{ |
|
String realPath; |
| |
#ifdef PEGASUS_PLATFORM_TRU64_ALPHA_DECCXX |
if (!existsNoCase(path, realPath)) |
if (is.good() != 0) |
|
return true; |
|
else |
|
return false; | return false; |
#endif |
|
| |
|
ArrayDestroyer<char> p(_clonePath(realPath)); |
|
|
|
fs.open(p.getPointer(), mode); |
|
return !!fs; |
} | } |
| |
Boolean FileSystem::isDirectory(const String& path) | Boolean FileSystem::isDirectory(const String& path) |
|
|
} | } |
} | } |
| |
|
Boolean GetLine(PEGASUS_STD(istream)& is, String& line) |
|
{ |
|
line.clear(); |
|
|
|
Boolean gotChar = false; |
|
char c; |
|
|
|
while (is.get(c)) |
|
{ |
|
gotChar = true; |
|
|
|
if (c == '\n') |
|
break; |
|
|
|
line.append(c); |
|
} |
|
|
|
return gotChar; |
|
} |
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |