diff options
Diffstat (limited to 'other/Kermit/include/SystemMap.hpp')
| -rw-r--r-- | other/Kermit/include/SystemMap.hpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/other/Kermit/include/SystemMap.hpp b/other/Kermit/include/SystemMap.hpp new file mode 100644 index 0000000..ff59094 --- /dev/null +++ b/other/Kermit/include/SystemMap.hpp | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | /* | ||
| 2 | * SystemMap.hpp: | ||
| 3 | * representation if a system map file (and alike). | ||
| 4 | * written by palmers / teso | ||
| 5 | */ | ||
| 6 | #ifndef SYSTEM_MAP_C | ||
| 7 | #define SYSTEM_MAP_C | ||
| 8 | |||
| 9 | #include <map> | ||
| 10 | #include <string> | ||
| 11 | #include <fstream> | ||
| 12 | |||
| 13 | /** | ||
| 14 | * Representation of a System.map file. It maps names to addresses. | ||
| 15 | */ | ||
| 16 | class SystemMap | ||
| 17 | { | ||
| 18 | private: | ||
| 19 | typedef map<string, unsigned int> blamap; | ||
| 20 | typedef blamap::value_type bla_val; | ||
| 21 | |||
| 22 | blamap add_map; | ||
| 23 | |||
| 24 | public: | ||
| 25 | /** | ||
| 26 | * Create a SystemMap object and read symbol names and addresses from a file. | ||
| 27 | */ | ||
| 28 | SystemMap (string file); | ||
| 29 | |||
| 30 | /** | ||
| 31 | * Create a SystemMap object and leave it empty. | ||
| 32 | */ | ||
| 33 | SystemMap (); | ||
| 34 | |||
| 35 | /** | ||
| 36 | * Foo. | ||
| 37 | */ | ||
| 38 | ~SystemMap (); | ||
| 39 | |||
| 40 | /** | ||
| 41 | * Check if a symbol (by name) is part of the object. | ||
| 42 | * @return true if the questioned symbol is part of the object (else false). | ||
| 43 | */ | ||
| 44 | bool contains (string); | ||
| 45 | |||
| 46 | /** | ||
| 47 | * Add a name, address pair to the object. | ||
| 48 | * @param name Symbolname. If a symbol with this name already exists | ||
| 49 | * it will not be added. | ||
| 50 | * @param address the address of the symbol. | ||
| 51 | */ | ||
| 52 | void add (string name, unsigned int address); | ||
| 53 | |||
| 54 | /** | ||
| 55 | * Random access operator for accessing elements in the form x = <name>[<symbol>]. | ||
| 56 | * @param name of a symbol. | ||
| 57 | * @return the address of symbol name. | ||
| 58 | */ | ||
| 59 | unsigned int operator[] (string name); | ||
| 60 | }; | ||
| 61 | #endif /* SYSTEM_MAP_C */ | ||
