Changeset 3538

Show
Ignore:
Timestamp:
04/30/07 18:04:35 (6 years ago)
Author:
balister
Message:

Fix path calculation for prf and scd files. They now use the path of the spd file that references them.

Location:
ossie/trunk/ossie
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • ossie/trunk/ossie/framework/ApplicationFactory_impl.cpp

    r3365 r3538  
    670670        spdFile->close(); 
    671671 
    672         CF::File_var scdFile = fileMgr->open(spd.getSoftPkgName(), true); 
     672        std::string scdPath; 
     673        CF::File_var scdFile = fileMgr->open(ossieSupport::spd_rel_file(component->getSPDFile(),spd.getSoftPkgName(), scdPath), true); 
    673674        SCDParser scd(scdFile); 
    674675        scdFile->close(); 
     
    687688         
    688689        // Extract Properties 
    689         CF::File_var prfFile = fileMgr->open(spd.getPRFFile(), true); 
     690        std::string prfPath; 
     691        CF::File_var prfFile = fileMgr->open(ossieSupport::spd_rel_file(component->getSPDFile(), spd.getPRFFile(), prfPath), true); 
    690692        PRFParser prf(prfFile); 
    691693        prfFile->close(); 
  • ossie/trunk/ossie/framework/DeviceManager_impl.cpp

    r3513 r3538  
    165165        tempDevice->initialize (); 
    166166         
    167         //Get properties from SPD 
    168     if (strlen(_SPDParser.getPRFFile ()) > 0){ 
    169         DEBUG(7, DevMgr, "getting PRF file: "<<_SPDParser.getPRFFile ()); 
    170             CF::File_var prfFile = _fileSys->open(_SPDParser.getPRFFile (), true); 
     167        if (strlen(_SPDParser.getPRFFile ()) > 0){ 
     168            DEBUG(7, DevMgr, "getting PRF file: "<<_SPDParser.getPRFFile ()); 
     169 
     170            //Get properties from SPD 
     171            std::string prfFilePath; 
     172            CF::File_var prfFile = _fileSys->open(ossieSupport::spd_rel_file(_DCDParser.getFileNameFromRefId(componentPlacements[i].refId()), _SPDParser.getPRFFile (), prfFilePath), true); 
    171173            PRFParser _PRFparser (prfFile); 
    172174            prfFile->close(); 
    173          
     175             
    174176            std::vector <PRFProperty *> *prfSimpleProp = _PRFparser.getConfigureProperties (); 
    175177            CF::Properties configCapacities; 
     
    178180                configCapacities[i] = *((*prfSimpleProp)[i]->getDataType ()); 
    179181            } 
    180          
     182             
    181183            //configure properties 
    182184            DEBUG(3, DevMgr, "Configuring capacities"); 
    183185            tempDevice->configure (configCapacities); 
    184     } 
     186        } 
     187 
    185188        DEBUG(3, DevMgr, "Registering device"); 
    186189        registerDevice (CF::Device::_duplicate(tempDevice)); 
  • ossie/trunk/ossie/framework/helperFunctions.cpp

    r3368 r3538  
    2525#include <boost/filesystem/path.hpp> 
    2626 
     27namespace fs = boost::filesystem; 
     28 
    2729#include <ossie/ossieSupport.h> 
    2830 
     
    3739{ 
    3840    try { 
    39         boost::filesystem::path testPath(fileName, boost::filesystem::portable_posix_name); 
     41        fs::path testPath(fileName, fs::portable_posix_name); 
    4042    } catch (...) { 
    4143        return false; 
     
    4446    return true; 
    4547} 
     48 
     49const char * ossieSupport::spd_rel_file(const char *spdFile, const char *name, std::string &fileName) 
     50{ 
     51 
     52    fs::path spdPath(spdFile); 
     53 
     54    fs::path filePath = spdPath.branch_path() / name; 
     55 
     56    fileName = filePath.string(); 
     57 
     58    return fileName.c_str(); 
     59} 
  • ossie/trunk/ossie/include/ossie/ossieSupport.h

    r3295 r3538  
    218218   void createProfileFromFileName(std::string fileName, std::string &profile); 
    219219   bool isValidFileName(const char* fileName); 
     220   const char *spd_rel_file(const char *spdfile, const char *name, std::string &fileName); 
     221 
    220222}  // Close ossieSupport Namespace 
    221223#endif