Added StarCatalogCrossReferences field.

This commit is contained in:
Chris Laurel 2001-08-08 23:53:57 +00:00
parent 7dbe1e33d4
commit 364ce6cc91
2 changed files with 32 additions and 1 deletions

View file

@ -98,6 +98,36 @@ CelestiaConfig* ReadCelestiaConfig(string filename)
}
}
Value* xrefsVal = configParams->getValue("StarCatalogCrossReferences");
if (xrefsVal != NULL)
{
if (xrefsVal->getType() != Value::ArrayType)
{
DPRINTF("%s: StarCatalogCrossReferences must be an array.\n", filename.c_str());
}
else
{
Array* xrefs = xrefsVal->getArray();
// assert(xrefs != NULL);
for (Array::iterator iter = xrefs->begin(); iter != xrefs->end(); iter++)
{
Value* xrefNameVal = *iter;
// assert(xrefNameVal != NULL);
if (xrefNameVal->getType() == Value::StringType)
{
config->catalogXrefFiles.insert(config->catalogXrefFiles.end(),
xrefNameVal->getString());
}
else
{
DPRINTF("%s: Catalog cross reference name must be a string.\n",
filename.c_str());
}
}
}
}
Value* labelledStarsVal = configParams->getValue("LabelledStars");
if (labelledStarsVal != NULL)
{

View file

@ -17,6 +17,7 @@ struct CelestiaConfig
{
std::string starDatabaseFile;
std::string starNamesFile;
std::vector<std::string> catalogXrefFiles;
std::vector<std::string> solarSystemFiles;
std::string galaxyCatalog;
std::vector<std::string> labelledStars;
@ -31,6 +32,6 @@ struct CelestiaConfig
};
CelestiaConfig* ReadCelestiaConfig(string filename);
CelestiaConfig* ReadCelestiaConfig(std::string filename);
#endif // _CONFIG_H_