Changeset 3613 for trunk/tools/common


Ignore:
Timestamp:
May 27, 2000, 4:14:21 AM (25 years ago)
Author:
bird
Message:

Corrected some bugs...

Location:
trunk/tools/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/common/kFile.cpp

    r3592 r3613  
    1 /* $Id: kFile.cpp,v 1.1 2000-05-23 18:23:05 bird Exp $
     1/* $Id: kFile.cpp,v 1.2 2000-05-27 02:14:20 bird Exp $
    22 *
    33 * kFile - Simple (for the time being) file class.
     
    4747
    4848
    49 
    5049/**
    5150 * Changes the real file position to match the virtual file position.
     
    7372    return TRUE;
    7473}
    75 
    7674
    7775
     
    116114        throw (rc);
    117115
    118     if (refreshFileStatus())
     116    if (!refreshFileStatus())
    119117        throw (rc);
    120118}
    121119
    122120
    123 
    124121/**
    125122 * Closes the file.
     
    129126    DosClose(hFile);
    130127}
    131 
    132128
    133129
     
    155151    return FALSE;
    156152}
    157 
    158153
    159154
     
    169164    return set(off) && read(pvBuffer, cbBuffer);
    170165}
    171 
    172166
    173167
     
    217211
    218212
    219 
    220213/**
    221214 * Seek relative to the current position.
     
    298291
    299292
    300 
    301293/**
    302294 * Get the size of the file.
     
    305297 * @remark      Will only throw error if refreshFileStatus failes.
    306298 */
    307 LONG            kFile::getSize()
     299long            kFile::getSize()
    308300{
    309301    if (!refreshFileStatus())
     
    313305}
    314306
     307
     308/**
     309 * Get current position.
     310 * @returns     The current file position.
     311 * @remark      Will only throw error if refreshFileStatus failes.
     312 */
     313long            kFile::getPos() const
     314{
     315    return offVirtual;
     316}
    315317
    316318
     
    334336
    335337
    336 
    337338/**
    338339 * Set error behaviour to fail by throwing the OS/2 return code when an
     
    367368 * @remark      Will never throw errors.
    368369 */
    369 int            kFile::getLastError()
     370int            kFile::getLastError() const
    370371{
    371372    return rc;
  • trunk/tools/common/kFile.h

    r3592 r3613  
    1 /* $Id: kFile.h,v 1.1 2000-05-23 18:23:05 bird Exp $
     1/* $Id: kFile.h,v 1.2 2000-05-27 02:14:21 bird Exp $
    22 *
    33 * kFile - Simple (for the time being) file class.
     
    3838
    3939    /** @cat internal methods for maintaing internal structures. */
    40     BOOL            refreshFileStatus();
    41     BOOL            position();
     40    BOOL            refreshFileStatus() throw(int);
     41    BOOL            position() throw(int);
    4242
    4343public:
     
    4747
    4848    /** @cat File I/O methods */
    49     BOOL            read(void *pvBuffer, long cbBuffer);
    50     BOOL            readAt(void *pvBuffer, long cbBuffer, long off);
     49    BOOL            read(void *pvBuffer, long cbBuffer) throw(int);
     50    BOOL            readAt(void *pvBuffer, long cbBuffer, long off) throw(int);
    5151
    52     BOOL            write(void *pvBuffer, long cbBuffer);
    53     BOOL            writeAt(void *pvBuffer, long cbBuffer, long off);
     52    BOOL            write(void *pvBuffer, long cbBuffer) throw(int);
     53    BOOL            writeAt(void *pvBuffer, long cbBuffer, long off) throw(int);
    5454
    5555    /** @cat File seek methods */
    56     BOOL            move(long off);
    57     BOOL            set(long off);
    58     BOOL            end();
     56    BOOL            move(long off) throw(int);
     57    BOOL            set(long off) throw(int);
     58    BOOL            end() throw(int);
    5959    BOOL            start();
    6060
    6161    /** @cat Query methods */
    62     LONG            getSize();
    63     BOOL            isEOF();
     62    long            getSize() throw(int);
     63    long            getPos() const throw(int);
     64    BOOL            isEOF() throw(int);
    6465
    6566    /** @cat Error handling */
    6667    BOOL            setThrowOnErrors();
    6768    BOOL            setFailOnErrors();
    68     int             getLastError();
     69    int             getLastError() const;
    6970};
    7071
Note: See TracChangeset for help on using the changeset viewer.