#ifndef IMPORT_H
#define IMPORT_H
#include <string>
#include "hub.h"
#include "location.h"

// ===========================================================
//	common import parameters
// -----------------------------------------------------------
class Import: public hub::Location {
protected:
	hub::Name fileName_; 			// input file name
    hub::LocationNames loc_;		// destination names

public:
	int kare;

    Import (hub::Hub* thehub, const std::string& fn = ""): 
    hub::Location (thehub),
    fileName_(fn)
    {}
    Import (hub::Library* theLib, const std::string& fn = ""): 
    hub::Location (theLib),
    fileName_(fn)
    {}
    Import (hub::Entity* theEnt, const std::string& fn = ""): 
    hub::Location (theEnt),
    fileName_(fn)
    {}
    Import (hub::Architecture* theArch, const std::string& fn = ""): 
    hub::Location (theArch),
    fileName_(fn)
    {}
    Import (const hub::Location& loc, const std::string& fn = ""): 
    hub::Location (loc),
    fileName_(fn)
    {}
    
    void fileName (const std::string& fn) { fileName_ = fn; }
    const std::string& fileName (void) { return fileName_; }	

    virtual void operator() (const std::string& ="")=0;
    virtual void operator() (hub::Library*,      const std::string& ="")=0;
    virtual void operator() (hub::Entity*,       const std::string& ="")=0;
    virtual void operator() (hub::Architecture*, const std::string& ="")=0;

    virtual ~Import (){}
    
    void libName       (const std::string& s) { loc_.libName(s); }
    void archName      (const std::string& s) { loc_.archName(s); }
    void entityName    (const std::string& s) { loc_.entityName(s); }
};
#endif
