I need to instantiate an object from a class, let's say Cat, and know the names of its included files.
The main program should look something like this:
#include <iostream>
#include <vector>
#include "Cat.h"
using namespace std;
vector<string> getIncludes(Cat cat){
...
}
int main(int argc, char *argv[])
{
Cat cat;
std::vector<string>list = getIncludes(cat);
}
And the Cat class header file would be like this:
#include "utils.h"
#include "animals.h"
class Cat{
public:
Cat();
~Cat();
void meow();
private:
int age;
}
After calling std::vector<string> list = getIncludes(cat)
, list
should contain "utils.h"
and "animals.h"
.
If there is another way to get those names in the main function I am open to suggestions. Thank you in advance.