Last change
on this file since df78cce was
634cb80,
checked in by Peter A. Buhr <pabuhr@…>, 12 months ago
|
formatting
|
-
Property mode set to
100644
|
File size:
636 bytes
|
Rev | Line | |
---|
[c0af102] | 1 | #include "Demangle.h" |
---|
[d1e0979] | 2 | #include <iostream> |
---|
| 3 | #include <fstream> |
---|
| 4 | |
---|
[c649d2c] | 5 | void demangleAndPrint(const std::string & mangleName) { |
---|
[90cac45] | 6 | char * demangleName = cforall_demangle(mangleName.c_str(), 0); |
---|
[c649d2c] | 7 | std::cout << mangleName << " => " << demangleName << std::endl; |
---|
[f47d0ad] | 8 | free(demangleName); |
---|
[d1e0979] | 9 | } |
---|
| 10 | |
---|
[c649d2c] | 11 | int main(int argc, char * argv[]) { |
---|
| 12 | char const * fileName = (1 < argc) ? argv[1] : "in-demangle.txt"; |
---|
| 13 | std::ifstream in(fileName); |
---|
| 14 | |
---|
[f47d0ad] | 15 | std::string line; |
---|
[c649d2c] | 16 | while (std::getline(in, line)) { |
---|
| 17 | if (line.empty()) { |
---|
| 18 | std::cout << "=================================" << std::endl; |
---|
| 19 | } else if (line[0] == '#') { |
---|
| 20 | continue; |
---|
| 21 | } else { |
---|
| 22 | demangleAndPrint(line); |
---|
| 23 | } |
---|
[f47d0ad] | 24 | } |
---|
[d1e0979] | 25 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.