Changed: #1440 Simplify reading the configuration

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent 55e24e4cdb
commit 9da45fc9f0

@ -30,6 +30,7 @@
// STL includes
#include <vector>
#include <sstream>
// NeL includes
#include <nel/misc/app_context.h>
@ -92,6 +93,27 @@ bool IPipelineProcess::getValue(sint &result, const std::string &name)
return true;
}
bool IPipelineProcess::getValuesRecurse(std::vector<std::string> &resultAppend, const std::string &name)
{
std::string::size_type split = name.find("[]");
if (split == std::string::npos) return getValues(resultAppend, name);
else
{
std::string subname = name.substr(0, split);
uint nb;
if (!getValueNb(nb, subname)) return false;
std::string begname = name.substr(0, split + 1);
std::string endname = name.substr(split + 1);
for (uint i = 0; i < nb; ++i)
{
std::stringstream ss;
ss << begname << i << endname;
if (!getValuesRecurse(resultAppend, ss.str())) return false;
}
}
return true;
}
} /* namespace PIPELINE */
/* end of file */

@ -95,6 +95,7 @@ public:
bool getValue(sint &result, const std::string &name);
virtual bool getValues(std::vector<std::string> &resultAppend, const std::string &name) = 0;
virtual bool getValueNb(uint &result, const std::string &name) = 0;
bool getValuesRecurse(std::vector<std::string> &resultAppend, const std::string &name);
/// Find out if the plugin needs to rebuild. Input can be files or directories, output can only be files
virtual bool needsToBeRebuilt(const std::vector<std::string> &inputPaths, const std::vector<std::string> &outputPaths, bool inputDepends) = 0;

@ -99,40 +99,7 @@ void CProcessInterface::build()
void CProcessInterfaceInfo::getDependentDirectories(std::vector<std::string> &resultAppend)
{
{
uint nb;
if (m_PipelineProcess->getValueNb(nb, "Interface.Atlas"))
{
for (uint i = 0; i < nb; ++i)
{
std::stringstream ss;
ss << "Interface.Atlas[" << i << "].SrcDirectories";
m_PipelineProcess->getValues(resultAppend, ss.str());
}
}
}
/*{
uint nb;
if (m_PipelineProcess->getValueNb(nb, "Interface.AtlasDxtc"))
{
for (uint i = 0; i < nb; ++i)
{
std::stringstream ss;
ss << "Interface.AtlasDxtc[" << i << "].SrcDirectories";
m_PipelineProcess->getValues(resultAppend, ss.str());
}
}
}
{
std::stringstream ss;
ss << "Interface.Fullscreen.SrcDirectories";
m_PipelineProcess->getValues(resultAppend, ss.str());
}
{
std::stringstream ss;
ss << "Interface.3D.SrcDirectories";
m_PipelineProcess->getValues(resultAppend, ss.str());
}*/
m_PipelineProcess->getValuesRecurse(resultAppend, "Interface.Atlas[].SrcDirectories");
}
void CProcessInterfaceInfo::getDependentFiles(std::vector<std::string> &resultAppend)

@ -131,7 +131,9 @@ void CProcessTextureDDS::build()
void CProcessTextureDDSInfo::getDependentDirectories(std::vector<std::string> &resultAppend)
{
{
m_PipelineProcess->getValuesRecurse(resultAppend, "Texture.DDS[].SrcDirectories");
/*{
uint nb;
if (m_PipelineProcess->getValueNb(nb, "Texture.DDS"))
{
@ -142,7 +144,7 @@ void CProcessTextureDDSInfo::getDependentDirectories(std::vector<std::string> &r
m_PipelineProcess->getValues(resultAppend, ss.str());
}
}
}
}*/
}
void CProcessTextureDDSInfo::getDependentFiles(std::vector<std::string> &resultAppend)

Loading…
Cancel
Save