Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 18, 2006, 12:04:54 PM (18 years ago)
Author:
ponder
Message:

Added byte_order.h to
Added binary_file.h binary_file.cc
Changed the bsp code to work on big endian machines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/terrain/src/lib/util/filesys/file.cc

    r8619 r9324  
    155155}
    156156
    157 bool File::open(OpenMode mode)
    158 {
    159 #warning implement
    160   return false;
     157bool File::open( OpenMode mode )
     158{
     159   static const char* openModeStrings[] = {
     160                        "r", "w", "r+", "a+" };
     161        _mode = mode;
     162        _handle = fopen( name().c_str(), openModeStrings[mode] );
     163        return ( _handle != NULL );
    161164}
    162165
    163166bool File::close()
    164167{
    165 #warning implement
    166   return false;
     168        if ( _handle != NULL ) {
     169                int success = fclose( _handle );
     170                _handle = NULL;         
     171                return ( success == 0 );
     172        }
     173        return false;
    167174}
    168175
Note: See TracChangeset for help on using the changeset viewer.