Ignore:
Timestamp:
2000-07-13T10:21:53+12:00 (24 years ago)
Author:
sjboddie
Message:

merged changes to trunk into New_Config_Format branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/New_Config_Format-branch/gsdl/lib/fileutil.cpp

    r1076 r1279  
    2828/*
    2929   $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
    3039   Revision 1.14  2000/04/06 19:57:59  cs025
    3140   Correcting a correction - reinstated all lib files due to silly
     
    118127  path2.erase (path2.begin(), here);
    119128 
    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;
    122143}
    123144
     
    139160bool file_exists (const text_t &filename) {
    140161  char *cstr = filename.getcstr();
     162#ifdef GSDL_USE_IOS_H
    141163  ifstream filestream (cstr, ios::in | ios::nocreate);
     164#else
     165  ifstream filestream (cstr, ios::in);
     166#endif
    142167  delete cstr;
    143168
     
    155180bool file_writable (const text_t &filename) {
    156181  char *cstr = filename.getcstr();
     182#ifdef GSDL_USE_IOS_H
    157183  ifstream filestream (cstr, ios::out | ios::nocreate);
     184#else
     185  ifstream filestream (cstr, ios::out);
     186#endif
    158187  delete cstr;
    159188
     
    168197}
    169198
    170 #if defined __WIN32__
     199#if defined(__WIN32__) && !defined(__GNUC__)
    171200
    172201#include <windows.h>
    173202
    174 BOOL read_dir (const text_t &dirname, text_tarray &filelist) {
     203bool read_dir (const text_t &dirname, text_tarray &filelist) {
    175204 
    176205  WIN32_FIND_DATA FileData; 
    177206  HANDLE hSearch;
    178   DWORD dwAttrs;
    179207  char *dirpath = dirname.getcstr();
    180208  strcat (dirpath, "\\*");
    181 
    182   BOOL finished = false;
    183209 
    184210  hSearch = FindFirstFile(dirpath, &FileData);
Note: See TracChangeset for help on using the changeset viewer.