root/ossie/trunk/ossie/framework/helperFunctions.cpp @ 3538

Revision 3538, 1.7 KB (checked in by balister, 6 years ago)

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

RevLine 
[3244]1/****************************************************************************
2
3Copyright 2007, Virginia Polytechnic Institute and State University
4
5This file is part of the OSSIE Core Framework.
6
7OSSIE Core Framework is free software; you can redistribute it and/or modify
8it under the terms of the Lesser GNU General Public License as published by
9the Free Software Foundation; either version 2.1 of the License, or
10(at your option) any later version.
11
12OSSIE Core Framework is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15Lesser GNU General Public License for more details.
16
17You should have received a copy of the Lesser GNU General Public License
18along with OSSIE Core Framework; if not, write to the Free Software
19Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
21****************************************************************************/
22
23#include <string>
24
[3264]25#include <boost/filesystem/path.hpp>
26
[3538]27namespace fs = boost::filesystem;
28
[3244]29#include <ossie/ossieSupport.h>
30
31void ossieSupport::createProfileFromFileName(std::string fileName, std::string &profile)
32{
[3368]33    profile = "<profile filename=\"" + fileName + "\" />";
[3244]34
35    return;
36}
[3264]37
38bool ossieSupport::isValidFileName(const char *fileName)
39{
[3268]40    try {
[3538]41        fs::path testPath(fileName, fs::portable_posix_name);
[3268]42    } catch (...) {
43        return false;
44    }
45
46    return true;
[3264]47}
[3538]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}
Note: See TracBrowser for help on using the browser.