Changeset 19812
- Timestamp:
- 02/14/07 11:28:11 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
juggler/branches/2.0/modules/jackal/config/jccl/Config/Configuration.cpp
r19802 r19812 182 182 << "' with parent file '" << parentfile << "'\n" << vprDEBUG_FLUSH; 183 183 184 mFileName = ParseUtil::expandFileName(filename, parentfile);185 186 vprDEBUG_OutputGuard(jcclDBG_CONFIG, vprDBG_CONFIG_LVL, 187 std::string("Loading config file ") + mFileName +188 std::string("\n"),189 std::string(""));184 const std::string expanded_filename = ParseUtil::expandFileName(filename, 185 parentfile); 186 187 std::ostringstream msg; 188 msg << "Loading config file '" << expanded_filename << "'\n"; 189 vprDEBUG_OutputGuard(jcclDBG_CONFIG, vprDBG_CONFIG_LVL, msg.str(), ""); 190 190 191 191 // XXX: Previously, this used ElementFactory::createXMLDocument(), but for … … 196 196 try 197 197 { 198 cfg_doc.loadFile( mFileName);198 cfg_doc.loadFile(expanded_filename); 199 199 200 200 cppdom::NodePtr cfg_node(cfg_doc.getChild(tokens::CONFIGURATION)); … … 222 222 223 223 // Load the file by making a recursive call to this method. We use 224 // mFileName so that the fully expanded path to the including file is225 // used as the "parent" file.226 load(cfg_filename, mFileName);224 // expanded_filename so that the fully expanded path to the including 225 // file is used as the "parent" file. 226 load(cfg_filename, expanded_filename); 227 227 } 228 228 229 229 // Load in the elements in the original file. 230 loadFromElementNode(cfg_node->getChild(tokens::ELEMENTS), mFileName); 230 loadFromElementNode(cfg_node->getChild(tokens::ELEMENTS), 231 expanded_filename); 232 233 // This is a recursive method, and we want to set mFileName as the last 234 // step of the loading process since that will end up using the 235 // original file name as the configuration file. 236 mFileName = expanded_filename; 237 vprDEBUG(jcclDBG_CONFIG, vprDBG_CONFIG_LVL) 238 << "Configuration file name: '" << mFileName << "'" << std::endl 239 << vprDEBUG_FLUSH; 231 240 232 241 status = true; … … 243 252 vprDEBUG(vprDBG_ERROR, vprDBG_CRITICAL_LVL) 244 253 << clrOutBOLD(clrRED, "Configuration XML Error:") << " " 245 << mFileName << ": line " << line_num << " at position " << pos246 << std::endl << vprDEBUG_FLUSH;254 << expanded_filename << ": line " << line_num << " at position " 255 << pos << std::endl << vprDEBUG_FLUSH; 247 256 vprDEBUG_NEXT(vprDBG_ERROR, vprDBG_CRITICAL_LVL) 248 257 << "Error: " << errmsg << std::endl << vprDEBUG_FLUSH; 249 258 250 259 // Print out the actual failed XML. 251 std::ifstream errfile( mFileName.c_str());260 std::ifstream errfile(expanded_filename.c_str()); 252 261 if ( errfile ) 253 262 {
