/[projet1]/public/pc/tools/osdk/main/FloppyBuilder/Floppy.cpp
Defence Force logotype

Diff of /public/pc/tools/osdk/main/FloppyBuilder/Floppy.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1276 by dbug, Wed Sep 17 18:46:58 2014 UTC revision 1277 by dbug, Fri May 29 18:07:19 2015 UTC
# Line 972  bool Floppy::AddDefine(std::string defin Line 972  bool Floppy::AddDefine(std::string defin
972  {  {
973    // Ugly token replacement, can do more optimal but as long as it works...    // Ugly token replacement, can do more optimal but as long as it works...
974    {    {
975      std::stringstream tempValue;      {
976      tempValue << m_FileEntries.size();        std::stringstream tempValue;
977      StringReplace(defineName ,"{FileIndex}",tempValue.str());        tempValue << m_FileEntries.size();
978      StringReplace(defineValue,"{FileIndex}",tempValue.str());        StringReplace(defineName ,"{FileIndex}",tempValue.str());
979          StringReplace(defineValue,"{FileIndex}",tempValue.str());
980        }
981    
982        if (m_FileEntries.empty())
983        {
984          ShowError("AddDefine %s: The {FileSize} directive can be used only after a file was added\n",defineName.c_str());
985        }
986        else
987        {
988          std::stringstream tempValue;
989          tempValue << m_FileEntries.back().m_FinalFileSize;
990          StringReplace(defineName ,"{FileSize}",tempValue.str());
991          StringReplace(defineValue,"{FileSize}",tempValue.str());
992        }
993    }    }
994    
995    m_DefineList.push_back(std::pair<std::string,std::string>(defineName,defineValue));    m_DefineList.push_back(std::pair<std::string,std::string>(defineName,defineValue));

Legend:
Removed from v.1276  
changed lines
  Added in v.1277

  ViewVC Help
Powered by ViewVC 1.1.26