Changeset 1279 for branches/New_Config_Format-branch/gsdl/lib/fileutil.cpp
- Timestamp:
- 2000-07-13T10:21:53+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/New_Config_Format-branch/gsdl/lib/fileutil.cpp
r1076 r1279 28 28 /* 29 29 $Log$ 30 Revision 1.14.2.1 2000/07/12 22:20:54 sjboddie 31 merged changes to trunk into New_Config_Format branch 32 33 Revision 1.16 2000/05/12 03:09:22 sjboddie 34 minor modifications to get web library compiling under VC++ 6.0 35 36 Revision 1.15 2000/05/04 08:27:28 sjboddie 37 modifications for windows ports of GCC 38 30 39 Revision 1.14 2000/04/06 19:57:59 cs025 31 40 Correcting a correction - reinstated all lib files due to silly … … 118 127 path2.erase (path2.begin(), here); 119 128 120 // return the concatenation of the two strings 121 return path1 + path2; 129 text_t fullpath = path1 + path2; 130 131 // make sure all the right slashes are used 132 here = fullpath.begin(); 133 end = fullpath.end(); 134 while (here != end) { 135 #ifdef __WIN32__ 136 if (*here == '/') *here = '\\'; 137 #else 138 if (*here == '\\') *here = '/'; 139 #endif 140 here ++; 141 } 142 return fullpath; 122 143 } 123 144 … … 139 160 bool file_exists (const text_t &filename) { 140 161 char *cstr = filename.getcstr(); 162 #ifdef GSDL_USE_IOS_H 141 163 ifstream filestream (cstr, ios::in | ios::nocreate); 164 #else 165 ifstream filestream (cstr, ios::in); 166 #endif 142 167 delete cstr; 143 168 … … 155 180 bool file_writable (const text_t &filename) { 156 181 char *cstr = filename.getcstr(); 182 #ifdef GSDL_USE_IOS_H 157 183 ifstream filestream (cstr, ios::out | ios::nocreate); 184 #else 185 ifstream filestream (cstr, ios::out); 186 #endif 158 187 delete cstr; 159 188 … … 168 197 } 169 198 170 #if defined __WIN32__199 #if defined(__WIN32__) && !defined(__GNUC__) 171 200 172 201 #include <windows.h> 173 202 174 BOOLread_dir (const text_t &dirname, text_tarray &filelist) {203 bool read_dir (const text_t &dirname, text_tarray &filelist) { 175 204 176 205 WIN32_FIND_DATA FileData; 177 206 HANDLE hSearch; 178 DWORD dwAttrs;179 207 char *dirpath = dirname.getcstr(); 180 208 strcat (dirpath, "\\*"); 181 182 BOOL finished = false;183 209 184 210 hSearch = FindFirstFile(dirpath, &FileData);
Note:
See TracChangeset
for help on using the changeset viewer.