| 1 | /* $Id: kInterfaces.h,v 1.1 2000-12-04 08:49:00 bird Exp $
|
|---|
| 2 | *
|
|---|
| 3 | * This headerfile contains interfaces for the common tools classes.
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
|---|
| 6 | *
|
|---|
| 7 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 8 | *
|
|---|
| 9 | */
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 | #ifndef _kInterfaces_h_
|
|---|
| 13 | #define _kInterfaces_h_
|
|---|
| 14 |
|
|---|
| 15 | /**
|
|---|
| 16 | * Interface class (ie. virtual) which defines the interface for
|
|---|
| 17 | * executables (resources and object too perhaps) files used to
|
|---|
| 18 | * get and put pages.
|
|---|
| 19 | * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
|---|
| 20 | */
|
|---|
| 21 | class kPageI
|
|---|
| 22 | {
|
|---|
| 23 | public:
|
|---|
| 24 | /** @cat Get and put page methods. */
|
|---|
| 25 |
|
|---|
| 26 | /**
|
|---|
| 27 | * Get a code, data or resource page from the file.
|
|---|
| 28 | * @returns Success indicator.
|
|---|
| 29 | * @param pachPage Pointer to a buffer of the size of a page which
|
|---|
| 30 | * will receive the page data on the specified address.
|
|---|
| 31 | * @param ulAddress Page address. This will be page aligned.
|
|---|
| 32 | */
|
|---|
| 33 | virtual BOOL getPage(char *pachPage, ULONG ulAddress) = 0;
|
|---|
| 34 |
|
|---|
| 35 | /**
|
|---|
| 36 | * Get a code, data or resource page from the file.
|
|---|
| 37 | * @returns Success indicator.
|
|---|
| 38 | * @param pachPage Pointer to a buffer of the size of a page which
|
|---|
| 39 | * will receive the page data on the specified address.
|
|---|
| 40 | * @param iObject Object number. (0-based)
|
|---|
| 41 | * @param offObject Offset into the object.
|
|---|
| 42 | * @remark Object = Section.
|
|---|
| 43 | */
|
|---|
| 44 | virtual BOOL getPage(char *pachPage, int iObject, int offObject) = 0;
|
|---|
| 45 |
|
|---|
| 46 | /**
|
|---|
| 47 | * Updates or adds a code, data, or resource page to the file.
|
|---|
| 48 | * @returns Success indicator.
|
|---|
| 49 | * @param pachPage Pointer to a buffer of the size of a page which
|
|---|
| 50 | * holds the page data.
|
|---|
| 51 | * @param ulAddress Page address. This will be page aligned.
|
|---|
| 52 | */
|
|---|
| 53 | virtual BOOL putPage(const char *pachPage, ULONG ulAddress) = 0;
|
|---|
| 54 |
|
|---|
| 55 | /**
|
|---|
| 56 | * Updates or adds a code, data, or resource page to the file.
|
|---|
| 57 | * @returns Success indicator.
|
|---|
| 58 | * @param pachPage Pointer to a buffer of the size of a page which
|
|---|
| 59 | * holds the page data.
|
|---|
| 60 | * @param iObject Object number. (0-based)
|
|---|
| 61 | * @param offObject Offset into the object.
|
|---|
| 62 | */
|
|---|
| 63 | virtual BOOL putPage(const char *pachPage, int iObject, int offObject) = 0;
|
|---|
| 64 |
|
|---|
| 65 | /**
|
|---|
| 66 | * Get pagesize for the file.
|
|---|
| 67 | * @returns Pagesize in bytes.
|
|---|
| 68 | */
|
|---|
| 69 | virtual int getPageSize() = 0;
|
|---|
| 70 | };
|
|---|
| 71 |
|
|---|
| 72 | #endif
|
|---|