Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
genwindef.cpp File Reference
#include "LibSymbolInfo.h"
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
Include dependency graph for genwindef.cpp:

Go to the source code of this file.

Namespaces

 windef
 

Functions

void windef::usage ()
 
int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 28 of file genwindef.cpp.

30 {
31  string outfile( "exports.def" );
32  string library( "UnknownLib" );
33  string objfiles;
34  bool debug( false );
35 
36  int arg;
37  if ( argc < 3 ) windef::usage();
38  arg = 1;
39  while ( argv[arg][0] == '-' ) {
40  if ( strcmp( argv[arg], "--" ) == 0 ) {
41  windef::usage();
42  } else if ( strcmp( argv[arg], "-l" ) == 0 ) {
43  arg++;
44  if ( arg == argc ) windef::usage();
45  library = argv[arg];
46  } else if ( strcmp( argv[arg], "-o" ) == 0 ) {
47  arg++;
48  if ( arg == argc ) windef::usage();
49  outfile = argv[arg];
50  }
51  arg++;
52  }
53  if ( arg == argc ) windef::usage();
54  for ( arg; arg < argc; arg++ ) {
55  objfiles += argv[arg];
56  if ( arg + 1 < argc ) objfiles += " ";
57  }
58 
59  CLibSymbolInfo libsymbols;
60  ofstream out( outfile );
61  if ( out.fail() ) {
62  cerr << "windef: Error opening file " << outfile << endl;
63  return 1;
64  }
65  out << "LIBRARY " << library << endl;
66  out << "EXPORTS" << endl;
67 
68  libsymbols.DumpSymbols( const_cast<char*>( objfiles.c_str() ), out );
69 
70  out.close();
71 
72  return 0;
73 }
list argv
Definition: gaudirun.py:294
T endl(T...args)
STL class.
T strcmp(T...args)
T c_str(T...args)
void usage()
Definition: genwindef.cpp:21
BOOL DumpSymbols(LPTSTR lpszLibPathName, std::ostream &pFile)