version 1.26, 2003/03/18 20:59:36
|
version 1.27, 2003/08/12 18:14:55
|
|
|
#include <Pegasus/Common/System.h> | #include <Pegasus/Common/System.h> |
#include <Pegasus/Common/Linkage.h> | #include <Pegasus/Common/Linkage.h> |
#include <fstream> | #include <fstream> |
|
#include <cstdio> |
|
#if defined(PEGASUS_OS_OS400) |
|
#include "OS400ConvertChar.h" |
|
#endif |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
| |
inline Boolean Open(PEGASUS_STD(ifstream)& is, const String& path) | inline Boolean Open(PEGASUS_STD(ifstream)& is, const String& path) |
{ | { |
|
#if defined(PEGASUS_OS_OS400) && defined(DAVES_CHANGES) |
|
CString tempPath = path.getCString(); |
|
const char * tmp = tempPath; |
|
AtoE((char *)tmp); |
|
is.open(tmp, PEGASUS_STD(_CCSID_T(1208))); |
|
#else |
is.open(path.getCString()); | is.open(path.getCString()); |
|
#endif |
return !!is; | return !!is; |
} | } |
| |
inline Boolean Open(PEGASUS_STD(ofstream)& os, const String& path) | inline Boolean Open(PEGASUS_STD(ofstream)& os, const String& path) |
{ | { |
|
#if defined(PEGASUS_OS_OS400) && defined(DAVES_CHANGES) |
|
CString tempPath = path.getCString(); |
|
const char * tmp = tempPath; |
|
AtoE((char *)tmp); |
|
os.open(tmp, PEGASUS_STD(_CCSID_T(1208))); |
|
#else |
os.open(path.getCString()); | os.open(path.getCString()); |
|
#endif |
return !!os; | return !!os; |
} | } |
| |
inline Boolean OpenAppend(PEGASUS_STD(ofstream)& os, const String& path) | inline Boolean OpenAppend(PEGASUS_STD(ofstream)& os, const String& path) |
{ | { |
|
#if defined(PEGASUS_OS_OS400) && defined(DAVES_CHANGES) |
|
CString tempPath = path.getCString(); |
|
const char * tmp = tempPath; |
|
AtoE((char *)tmp); |
|
os.open(tmp, PEGASUS_STD(ios::app), PEGASUS_STD(_CCSID_T(1208))); |
|
#else |
os.open(path.getCString(), PEGASUS_STD(ios::app)); | os.open(path.getCString(), PEGASUS_STD(ios::app)); |
|
#endif |
return !!os; | return !!os; |
} | } |
| |