// --- std::string VSWContentPrjSaver::extractPathsFrom (VSWContentProjectPt cntPrj, const std::string& pToFile) { #ifdef __DEBUGSYSTEM __KEEPENTRYSIMPLETRACE #endif // The chain of paths, returned at the end of the method. std::string result (__NULL_STRING__); // Variables used only temporaly to iterate over the elements... PathsList finalPaths; PathsList::const_iterator i; // Iterates over all the data paths, // generating the real rel path, and only keeping one versión of that- finalPaths = PathsList (); for (i = _temporalPathsForData.begin (); i != _temporalPathsForData.end (); i++) { // First, get only the path of the xml file keeped... std::string relPath = std::string (".") + std::string (__PATH_SEPARATOR__); std::string fileName = (*i); if (fileName.find_last_of (std::string (__PATH_SEPARATOR__)) != -1) relPath = fileName.substr (0, fileName.find_last_of (__PATH_SEPARATOR__)); relPath = relPathFor (relPath, _theData -> valueForVariable (std::string (__VARBASICPATH__))); // The look for the recient found structure int the just existing ones // If it is not found, then it will be inserted. QBOOLEAN existsPath = QFALSE; for (PathsList::const_iterator j = finalPaths.begin (); j != finalPaths.end () && !existsPath; j++) if ((*j) == relPath) existsPath = QTRUE; if (!existsPath) { finalPaths.push_back (relPath); result += std::string ("\t\t<") + std::string (__PRJCONTENTPATHXML_TAGNAME__) + std::string (" ") + std::string (__PRJPATHXML_VARRELPATH__) + std::string ("=\"") + relPath + std::string ("\"/>\n"); } } // Iterates over all the content paths, // generating the real rel path, and only keeping one versión of that- finalPaths = PathsList (); for (i = _temporalPathsForContents.begin (); i != _temporalPathsForContents.end (); i++) { // First, get only the path of the xml file keeped... std::string relPath = std::string (".") + std::string (__PATH_SEPARATOR__); std::string fileName = (*i); if (fileName.find_last_of (std::string (__PATH_SEPARATOR__)) != -1) relPath = fileName.substr (0, fileName.find_last_of (__PATH_SEPARATOR__)); relPath = relPathFor (relPath, _theData -> valueForVariable (std::string (__VARBASICPATH__))); // The look for the recient found structure int the just existing ones // If it is not found, then it will be inserted. QBOOLEAN existsPath = QFALSE; for (PathsList::const_iterator j = finalPaths.begin (); j != finalPaths.end () && !existsPath; j++) if ((*j) == relPath) existsPath = QTRUE; if (!existsPath) { finalPaths.push_back (relPath); result += std::string ("\t\t<") + std::string (__PRJCONTENTSDESCRIPTORPATHXML_TAGNAME__) + std::string (" ") + std::string (__PRJPATHXML_VARRELPATH__) + std::string ("=\"") + relPath + std::string ("\"/>\n"); } } // Iterates over all the sequence paths, // generating the real rel path, and only keeping one versión of that- finalPaths = PathsList (); for (i = _temporalPathsForSequences.begin (); i != _temporalPathsForSequences.end (); i++) { // First, get only the path of the xml file keeped... std::string relPath = std::string (".") + std::string (__PATH_SEPARATOR__); std::string fileName = (*i); if (fileName.find_last_of (std::string (__PATH_SEPARATOR__)) != -1) relPath = fileName.substr (0, fileName.find_last_of (__PATH_SEPARATOR__)); relPath = relPathFor (relPath, _theData -> valueForVariable (std::string (__VARBASICPATH__))); // The look for the recient found structure int the just existing ones // If it is not found, then it will be inserted. QBOOLEAN existsPath = QFALSE; for (PathsList::const_iterator j = finalPaths.begin (); j != finalPaths.end () && !existsPath; j++) if ((*j) == relPath) existsPath = QTRUE; if (!existsPath) { finalPaths.push_back (relPath); result += std::string ("\t\t<") + std::string (__PRJSEQUENCESDESCRIPTORPATHXML_TAGNAME__) + std::string (" ") + std::string (__PRJPATHXML_VARRELPATH__) + std::string ("=\"") + relPath + std::string ("\"/>\n"); } } // Iterates over all the schedulings paths, // generating the real rel path, and only keeping one versión of that- finalPaths = PathsList (); for (i = _temporalPathsForSchedulings.begin (); i != _temporalPathsForSchedulings.end (); i++) { // First, get only the path of the xml file keeped... std::string relPath = std::string (".") + std::string (__PATH_SEPARATOR__); std::string fileName = (*i); if (fileName.find_last_of (std::string (__PATH_SEPARATOR__)) != -1) relPath = fileName.substr (0, fileName.find_last_of (__PATH_SEPARATOR__)); relPath = relPathFor (relPath, _theData -> valueForVariable (std::string (__VARBASICPATH__))); // The look for the recient found structure int the just existing ones // If it is not found, then it will be inserted. QBOOLEAN existsPath = QFALSE; for (PathsList::const_iterator j = finalPaths.begin (); j != finalPaths.end () && !existsPath; j++) if ((*j) == relPath) existsPath = QTRUE; if (!existsPath) { finalPaths.push_back (relPath); result += std::string ("\t\t<") + std::string (__PRJSCHEDULINGSDESCRIPTORPATHXML_TAGNAME__) + std::string (" ") + std::string (__PRJPATHXML_VARRELPATH__) + std::string ("=\"") + relPath + std::string ("\"/>\n"); } } #ifdef __DEBUGSYSTEM __KEEPEXITSIMPLETRACE #endif // Return the result return (result); }
void AddPath(Path* p) { paths.push_back(shared_ptr < Path > (p)); }