(file) Return to DirPOSIX.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/DirPOSIX.cpp between version 1.3 and 1.4

version 1.3, 2006/11/07 21:30:36 version 1.4, 2007/06/05 09:31:18
Line 36 
Line 36 
  
 #include <iostream> #include <iostream>
  
 #ifdef PEGASUS_OS_OS400  
 typedef struct os400_pnstruct  
 {  
   Qlg_Path_Name_T qlg_struct;  
   char * pn;  
 } OS400_PNSTRUCT;  
 #endif  
   
   
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 // Clone the string to a plain old C-String and null out // Clone the string to a plain old C-String and null out
Line 63 
Line 54 
 Dir::Dir(const String& path) Dir::Dir(const String& path)
     : _path(path)     : _path(path)
 { {
   
 #ifdef PEGASUS_OS_OS400  
     CString tmpPathclone = _clonePath(_path);  
     const char* tmpPath = tmpPathclone;  
     OS400_PNSTRUCT pathname;  
     memset((void*)&pathname, 0x00, sizeof(OS400_PNSTRUCT));  
     pathname.qlg_struct.CCSID = 1208;  
 #pragma convert(37)  
     memcpy(pathname.qlg_struct.Country_ID,"US",2);  
     memcpy(pathname.qlg_struct.Language_ID,"ENU",3);  
 #pragma convert(0)  
     pathname.qlg_struct.Path_Type = QLG_PTR_SINGLE;  
     pathname.qlg_struct.Path_Length = strlen(tmpPath);  
     pathname.qlg_struct.Path_Name_Delimiter[0] = '/';  
     pathname.pn = (char *)tmpPath;  
     _dirRep.dir = QlgOpendir((Qlg_Path_Name_T *)&pathname);  
 #else  
     _dirRep.dir = opendir(_clonePath(_path));     _dirRep.dir = opendir(_clonePath(_path));
 #endif  
     if (_dirRep.dir)     if (_dirRep.dir)
     {     {
 #ifdef PEGASUS_HAS_READDIR_R #ifdef PEGASUS_HAS_READDIR_R
         // Need to use readdir_r since we are multithreaded         // Need to use readdir_r since we are multithreaded
 #ifdef PEGASUS_OS_OS400  
         if (QlgReaddir_r(_dirRep.dir, &_dirRep.buffer, &_dirRep.entry) != 0)  
 #else  
         if (readdir_r(_dirRep.dir, &_dirRep.buffer, &_dirRep.entry) != 0)         if (readdir_r(_dirRep.dir, &_dirRep.buffer, &_dirRep.entry) != 0)
 #endif  
         {         {
             _more = false;             _more = false;
             closedir(_dirRep.dir);             closedir(_dirRep.dir);
Line 118 
Line 88 
  
 const char* Dir::getName() const const char* Dir::getName() const
 { {
 #ifdef PEGASUS_OS_OS400  
     _dirRep.entry->d_lg_name[_dirRep.entry->d_lg_qlg.Path_Length] = 0x00;  
     return _more ? _dirRep.entry->d_lg_name : "";  
 #else  
     return _more ? _dirRep.entry->d_name : "";     return _more ? _dirRep.entry->d_name : "";
 #endif  
 } }
  
 void Dir::next() void Dir::next()
Line 132 
Line 97 
     {     {
 #ifdef PEGASUS_HAS_READDIR_R #ifdef PEGASUS_HAS_READDIR_R
         // Need to use readdir_r since we are multithreaded         // Need to use readdir_r since we are multithreaded
 #ifdef PEGASUS_OS_OS400  
         if (QlgReaddir_r(_dirRep.dir, &_dirRep.buffer, &_dirRep.entry) != 0)  
 #else  
 #ifdef PEGASUS_OS_ZOS #ifdef PEGASUS_OS_ZOS
     errno=0;     errno=0;
 #endif #endif
     if (readdir_r(_dirRep.dir, &_dirRep.buffer, &_dirRep.entry) != 0)     if (readdir_r(_dirRep.dir, &_dirRep.buffer, &_dirRep.entry) != 0)
 #endif  
         {         {
             _more = false;             _more = false;
             throw CannotOpenDirectory(_path);             throw CannotOpenDirectory(_path);


Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2