63 std::string::size_type pos = FileName.find(
'\\');
65 while (pos != std::string::npos)
68 pos = FileName.find(
'\\', pos);
83 std::string NewFile = FileName;
84 std::string ExistingFile;
86 for (; it != end; ++it)
88 ExistingFile = *(*it)->getValue().pSTRING;
89 (*it)->setValue(NewFile);
91 if (ExistingFile == FileName)
return;
93 NewFile = ExistingFile;
106 mpRecentSBMLFiles(NULL),
107 mpRecentSEDMLFiles(NULL),
108 mpRecentMIRIAMResources(NULL),
109 mpApplicationFont(NULL),
110 mpValidateUnits(NULL),
112 mpUseAdvancedSliders(NULL),
113 mpUseAdvancedEditing(NULL),
114 mpNormalizePerExperiment(NULL),
115 mpWorkingDirectory(NULL)
122 mpRecentSBMLFiles(NULL),
123 mpRecentSEDMLFiles(NULL),
124 mpRecentMIRIAMResources(NULL),
125 mpApplicationFont(NULL),
126 mpValidateUnits(NULL),
128 mpUseAdvancedSliders(NULL),
129 mpUseAdvancedEditing(NULL),
130 mpNormalizePerExperiment(NULL),
131 mpWorkingDirectory(NULL)
138 mpRecentSBMLFiles(NULL),
139 mpRecentSEDMLFiles(NULL),
140 mpRecentMIRIAMResources(NULL),
141 mpApplicationFont(NULL),
142 mpValidateUnits(NULL),
144 mpUseAdvancedSliders(NULL),
145 mpUseAdvancedEditing(NULL),
146 mpNormalizePerExperiment(NULL),
147 mpWorkingDirectory(NULL)
158 elevate<CRecentFiles, CCopasiParameterGroup>(
getGroup(
"Recent Files"));
163 elevate<CRecentFiles, CCopasiParameterGroup>(
getGroup(
"Recent SBML Files"));
168 elevate<CRecentFiles, CCopasiParameterGroup>(
getGroup(
"Recent SEDML Files"));
173 elevate<CMIRIAMResources, CCopasiParameterGroup>(
getGroup(
"MIRIAM Resources"));
204 std::string ConfigFile;
211 bool success = XML.CCopasiXMLInterface::save(ConfigFile, ConfigFile);
218 std::string ConfigFile;
223 bool success = XML.CCopasiXMLInterface::load(ConfigFile, ConfigFile);
234 std::string MIRIAMResourceFile;
240 if (XMLMIRIAMResource.CCopasiXMLInterface::load(MIRIAMResourceFile,
245 if (group == NULL)
return false;
345 mConfiguration(
"Configuration")
357 const std::string & relativeTo)
361 os.imbue(std::locale::classic());
366 *mpOstream <<
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
369 *mpOstream <<
"<!-- generated with COPASI "
371 <<
" (http://www.copasi.org) at "
376 saveParameter(mConfiguration);
382 const std::string & relativeTo)
386 is.imbue(std::locale::classic());
396 #define BUFFER_SIZE 0xfffe
403 if (mpIstream->eof()) done =
true;
405 if (mpIstream->fail() && !done)
407 std::string ConfigFile;
415 if (!Parser.
parse(pBuffer, -1, done))
437 mConfiguration.
clear();
443 {mConfiguration = configuration;}
446 {
return mConfiguration;}
CCopasiParameterGroup * mpRecentFiles
void initializeParameter()
std::string * mpApplicationFont
unsigned C_INT32 * mpMaxFiles
static void setMIRIAMResources(const CMIRIAMResources *pResources)
static bool isRelativePath(const std::string &path)
const CCopasiParameterGroup & getConfiguration() const
const std::string getWorkingDirectory() const
const CCopasiParameterGroup & getResourceList() const
virtual ~CConfigurationFile()
void setUseAdvancedSliders(bool useAdvancedSliders)
void initializeParameter()
virtual bool save(std::ostream &os, const std::string &relativeTo)
const std::string getApplicationFont() const
void setUseAdvancedEditing(bool useAdvancedEditing)
index_iterator endIndex() const
CRecentFiles & getRecentFiles()
static std::string fileName(const std::string &path)
std::string * mpWorkingDirectory
void setUseOpenGL(bool useOpenGL)
CRecentFiles * mpRecentSEDMLFiles
bool * mpUseAdvancedSliders
bool normalizePerExperiment() const
void setWorkingDirectory(const std::string &workingDirectory)
bool useAdvancedSliders() const
CMIRIAMResources & getRecentMIRIAMResources()
bool useAdvancedEditing() const
bool * mpUseAdvancedEditing
static const std::string Separator
void addFile(const std::string &file)
index_iterator beginIndex() const
const Value & getValue() const
int getCurrentColumnNumber()
CRecentFiles * mpRecentFiles
CCopasiParameterGroup * assertGroup(const std::string &name)
CRecentFiles & getRecentSBMLFiles()
void setValidateUnits(bool validateUnits)
CRecentFiles & getRecentSEDMLFiles()
void setApplicationFont(const std::string &applicationFont)
static void getValue(const std::string &name, CType &value)
CCopasiParameterGroup mConfiguration
CRecentFiles(const std::string &name="Recent Files", const CCopasiContainer *pParent=NULL)
virtual bool load(std::istream &is, const std::string &relativeTo)
void setRecentMIRIAMResources(const CMIRIAMResources &miriamResources)
virtual bool elevateChildren()
CMIRIAMResources * mpRecentMIRIAMResources
void setConfiguration(const CCopasiParameterGroup &configuration)
void setNormalizePerExperiment(bool flag)
bool addParameter(const CCopasiParameter ¶meter)
std::string UTCTimeStamp()
CConfigurationFile(const std::string &name="Configuration", const CCopasiContainer *pParent=NULL)
CRecentFiles * mpRecentSBMLFiles
static std::string normalize(const std::string &path)
int getCurrentLineNumber() const
bool parse(const char *pszBuffer, int nLength=-1, bool fIsFinal=true)
CCopasiParameter * assertParameter(const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue)
CCopasiParameterGroup * getGroup(const std::string &name)
const XML_LChar * getErrorString()
static bool makePathAbsolute(std::string &relativePath, const std::string &absoluteTo)
const CCopasiParameterGroup * getCurrentGroup() const
bool setObjectName(const std::string &name)
const std::string & getVersion() const
parameterGroup::iterator index_iterator
bool * mpNormalizePerExperiment
void initializeParameter()
bool validateUnits() const
static const CVersion VERSION