HPCToolkit
InputFile.hpp
Go to the documentation of this file.
1 // * BeginRiceCopyright *****************************************************
2 //
3 // $HeadURL$
4 // $Id$
5 //
6 // --------------------------------------------------------------------------
7 // Part of HPCToolkit (hpctoolkit.org)
8 //
9 // Information about sources of support for research and development of
10 // HPCToolkit is at 'hpctoolkit.org' and in 'README.Acknowledgments'.
11 // --------------------------------------------------------------------------
12 //
13 // Copyright ((c)) 2002-2019, Rice University
14 // All rights reserved.
15 //
16 // Redistribution and use in source and binary forms, with or without
17 // modification, are permitted provided that the following conditions are
18 // met:
19 //
20 // * Redistributions of source code must retain the above copyright
21 // notice, this list of conditions and the following disclaimer.
22 //
23 // * Redistributions in binary form must reproduce the above copyright
24 // notice, this list of conditions and the following disclaimer in the
25 // documentation and/or other materials provided with the distribution.
26 //
27 // * Neither the name of Rice University (RICE) nor the names of its
28 // contributors may be used to endorse or promote products derived from
29 // this software without specific prior written permission.
30 //
31 // This software is provided by RICE and contributors "as is" and any
32 // express or implied warranties, including, but not limited to, the
33 // implied warranties of merchantability and fitness for a particular
34 // purpose are disclaimed. In no event shall RICE or contributors be
35 // liable for any direct, indirect, incidental, special, exemplary, or
36 // consequential damages (including, but not limited to, procurement of
37 // substitute goods or services; loss of use, data, or profits; or
38 // business interruption) however caused and on any theory of liability,
39 // whether in contract, strict liability, or tort (including negligence
40 // or otherwise) arising in any way out of the use of this software, even
41 // if advised of the possibility of such damage.
42 //
43 // ******************************************************* EndRiceCopyright *
44 
45 
46 //***************************************************************************
47 //
48 // File: InputFile.hpp
49 //
50 // Purpose:
51 // Open a file and return a vector that will contain a pointer to the
52 // Elf representation of that file as well pointers to any Elf files
53 // nested inside.
54 //
55 //***************************************************************************
56 
57 
58 #ifndef __InputFile_hpp__
59 #define __InputFile_hpp__
60 
61 //******************************************************************************
62 // system includes
63 //******************************************************************************
64 
65 #include <string>
66 
67 
68 
69 //******************************************************************************
70 // forward declarations
71 //******************************************************************************
72 
73 class ElfFileVector;
74 
75 
76 
77 //******************************************************************************
78 // type definitions
79 //******************************************************************************
80 
81 class InputFile {
82 public:
83  InputFile() { filevector = 0; }
84  bool openFile(std::string &filename);
85  std::string &fileName() { return filename; }
86  const char *CfileName() { return filename.c_str(); }
88 private:
89  std::string filename;
91 };
92 
93 #endif
ElfFileVector * filevector
Definition: InputFile.hpp:90
const char * CfileName()
Definition: InputFile.hpp:86
std::string & fileName()
Definition: InputFile.hpp:85
bool openFile(std::string &filename)
Definition: InputFile.cpp:128
std::string filename
Definition: InputFile.hpp:89
ElfFileVector * fileVector()
Definition: InputFile.hpp:87