Ignore:
Timestamp:
Oct 2, 2000, 6:01:40 AM (25 years ago)
Author:
bird
Message:

Added some limited dump capabilities for PE executables.

File:
1 edited

Legend:

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

    r4129 r4358  
    1 /* $Id: kFile.cpp,v 1.4 2000-08-31 03:00:12 bird Exp $
     1/* $Id: kFile.cpp,v 1.5 2000-10-02 04:01:39 bird Exp $
    22 *
    33 * kFile - Simple (for the time being) file class.
    44 *
    5  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     5 * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    2626#include <stdio.h>
    2727
    28 #include <kFile.h>
     28#include "kFile.h"
     29
     30/*******************************************************************************
     31*   Global Variables                                                           *
     32*******************************************************************************/
     33kFile kFile::StdIn((HFILE)0, TRUE);
     34kFile kFile::StdOut((HFILE)1, FALSE);
     35kFile kFile::StdErr((HFILE)2, FALSE);
    2936
    3037
     
    3744BOOL    kFile::refreshFileStatus()
    3845{
     46    if (fStdDev)
     47        return fStatusClean = TRUE;
     48
    3949    if (!fStatusClean)
    4050    {
     
    7787}
    7888
     89/**
     90 * Creates a kFile object for a file that is opened allready.
     91 *  Intended use for the three standard handles only.
     92 *
     93 * @returns     <object> with state updated.
     94 * @param       pszFilename     Filename.
     95 * @param       fReadOnly       TRUE:  Open the file readonly.
     96 *                              FALSE: Open the file readwrite appending
     97 *                                     existing files.
     98 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     99 */
     100kFile::kFile(HFILE hFile, BOOL fReadOnly)
     101:   fReadOnly(fReadOnly),
     102    fStatusClean(FALSE),
     103    fThrowErrors(FALSE),
     104    offVirtual(0),
     105    offReal(0),
     106    pszFilename(NULL),
     107    hFile(hFile),
     108    fStdDev(TRUE)
     109{
     110    if (!refreshFileStatus())
     111        throw ((int)rc);
     112    this->pszFilename = strdup("");
     113}
     114
    79115
    80116/**
     
    86122 *                              FALSE: Open the file readwrite appending
    87123 *                                     existing files.
    88  * @author      knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     124 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    89125 */
    90126kFile::kFile(const char *pszFilename, BOOL fReadOnly/*=TRUE*/)
     
    94130    offVirtual(0),
    95131    offReal(0),
    96     pszFilename(NULL)
     132    pszFilename(NULL),
     133    fStdDev(FALSE)
    97134{
    98135    ULONG   fulOpenFlags;
Note: See TracChangeset for help on using the changeset viewer.