#include <iostream>
#endif
+#ifdef WIN32
+ static const char FSEP = '\\';
+#else
+ static const char FSEP = '/';
+#endif
+
Config_XMLReader::Config_XMLReader(const std::string& theXmlFileName)
: myXmlDoc(NULL)
{
if (prefix.empty())
prefix = pluginConfigFile();
-#ifdef WIN32
- prefix += "\\";
-#else
- prefix += "/";
-#endif
- myDocumentPath = prefix + theXmlFileName;
+ myDocumentPath = prefix + FSEP + theXmlFileName;
std::ifstream aTestFile(myDocumentPath);
if (!aTestFile) Events_Error::send("Unable to open " + myDocumentPath);
aTestFile.close();
std::string aValue;
char* anEnv = getenv("SHAPER_ROOT_DIR");
if (anEnv) {
- aValue = std::string(anEnv);
+ aValue = std::string(anEnv) +
+ FSEP + "share" + FSEP + "salome" + FSEP + "resources" + FSEP + "shaper";
} else {
anEnv = getenv("OPENPARTS_ROOT_DIR");
- if (anEnv)
- aValue = std::string(anEnv);
+ if (anEnv) {
+ aValue = std::string(anEnv) + FSEP + "plugins";
+ }
}
-#ifdef WIN32
- aValue += "\\";
-#else
- aValue += "/";
-#endif
- aValue += "plugins";
return aValue;
}
std::string aFile;
char* anEnv = getenv("SHAPER_ROOT_DIR");
if (anEnv) {
- aFile = std::string(anEnv);
+ aFile = std::string(anEnv) +
+ FSEP + "share" + FSEP + "salome" + FSEP + "resources" + FSEP + "shaper";
} else {
anEnv = getenv("OPENPARTS_ROOT_DIR");
if (anEnv)
- aFile = std::string(anEnv);
+ aFile = std::string(anEnv) + FSEP + "resources";
}
- aFile += FSEP;
- aFile += "resources";
aFile += FSEP;
aFile += iconName();