+
+ //=========================================================================
+ bool ConfigurationFile::AddPackagePathsAndWrite( const std::string& path )
+ {
+ bbtkDebugMessageInc("config",9,
+ "ConfigurationFile::AddPackagePathsAndWrite("
+ <<path<<")"<<std::endl);
+
+ XMLResults* res = new XMLResults;
+ XMLNode BB =
+ XMLNode::parseFile((XMLCSTR)Get_config_xml_full_path().c_str(),
+ (XMLCSTR)"config",res);
+
+ if ( res->error != eXMLErrorNone )
+ {
+ std::string mess = GetErrorMessage(res,Get_config_xml_full_path());
+ delete res;
+ bbtkDebugMessage("config",1,mess<< std::endl);
+ bbtkError(mess);
+ }
+ delete res;
+
+#ifdef _WIN32
+ std::string bbs_path = path + "/bbs";
+#else
+ std::string bbs_path = path + "/share/bbtk/bbs" ;
+#endif
+ XMLNode BBSPATH = BB.addChild((XMLCSTR)"bbs_path");
+ BBSPATH.addText((XMLCSTR)bbs_path.c_str());
+ Utilities::replace(bbs_path, INVALID_FILE_SEPARATOR, VALID_FILE_SEPARATOR);
+ mBbs_paths.push_back(bbs_path);
+
+#ifdef _WIN32
+ std::string pack_path = path + "/bin";
+#else
+ std::string pack_path = path ;
+#endif
+ XMLNode PACKPATH = BB.addChild((XMLCSTR)"package_path");
+ PACKPATH.addText((XMLCSTR)pack_path.c_str());
+ Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
+ mPackage_paths.push_back(pack_path);
+
+#ifdef _WIN32
+ pack_path = path + "/RelWithDebInfo";
+ PACKPATH = BB.addChild((XMLCSTR)"package_path");
+ PACKPATH.addText((XMLCSTR)pack_path.c_str());
+ Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
+ mPackage_paths.push_back(pack_path);
+ pack_path = path + "/Debug";
+ PACKPATH = BB.addChild((XMLCSTR)"package_path");
+ PACKPATH.addText((XMLCSTR)pack_path.c_str());
+ Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
+ mPackage_paths.push_back(pack_path);
+ pack_path = path + "/Release";
+ PACKPATH = BB.addChild((XMLCSTR)"package_path");
+ PACKPATH.addText((XMLCSTR)pack_path.c_str());
+ Utilities::replace(pack_path,INVALID_FILE_SEPARATOR,VALID_FILE_SEPARATOR);
+ mPackage_paths.push_back(pack_path);
+#endif
+
+
+ XMLError err = BB.writeToFile((XMLCSTR)Get_config_xml_full_path().c_str());
+ if ( err != eXMLErrorNone )
+ {
+ std::string mess = GetErrorMessage(res,Get_config_xml_full_path());
+ bbtkDebugMessage("config",1,mess<< std::endl);
+ bbtkError(mess);
+ }
+
+ return true;
+ }
+ //=========================================================================