Changeset 19811
- Timestamp:
- 02/14/07 11:27:03 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
juggler/trunk/modules/jackal/config/jccl/Config/Configuration.cpp
r19801 r19811 176 176 << "' with parent file '" << parentfile << "'\n" << vprDEBUG_FLUSH; 177 177 178 mFileName = ParseUtil::expandFileName(filename, parentfile);179 180 vprDEBUG_OutputGuard(jcclDBG_CONFIG, vprDBG_CONFIG_LVL, 181 std::string("Loading config file ") + mFileName +182 std::string("\n"),183 std::string(""));178 const std::string expanded_filename = ParseUtil::expandFileName(filename, 179 parentfile); 180 181 std::ostringstream msg; 182 msg << "Loading config file '" << expanded_filename << "'\n"; 183 vprDEBUG_OutputGuard(jcclDBG_CONFIG, vprDBG_CONFIG_LVL, msg.str(), ""); 184 184 185 185 // XXX: Previously, this used ElementFactory::createXMLDocument(), but for … … 190 190 try 191 191 { 192 cfg_doc.loadFile( mFileName);192 cfg_doc.loadFile(expanded_filename); 193 193 194 194 cppdom::NodePtr cfg_node(cfg_doc.getChild(tokens::CONFIGURATION)); … … 216 216 217 217 // Load the file by making a recursive call to this method. We use 218 // mFileName so that the fully expanded path to the including file is219 // used as the "parent" file.220 load(cfg_filename, mFileName);218 // expanded_filename so that the fully expanded path to the including 219 // file is used as the "parent" file. 220 load(cfg_filename, expanded_filename); 221 221 } 222 222 223 223 // Load in the elements in the original file. 224 loadFromElementNode(cfg_node->getChild(tokens::ELEMENTS), mFileName); 224 loadFromElementNode(cfg_node->getChild(tokens::ELEMENTS), 225 expanded_filename); 226 227 // This is a recursive method, and we want to set mFileName as the last 228 // step of the loading process since that will end up using the 229 // original file name as the configuration file. 230 mFileName = expanded_filename; 231 vprDEBUG(jcclDBG_CONFIG, vprDBG_CONFIG_LVL) 232 << "Configuration file name: '" << mFileName << "'" << std::endl 233 << vprDEBUG_FLUSH; 225 234 226 235 status = true; … … 237 246 vprDEBUG(vprDBG_ERROR, vprDBG_CRITICAL_LVL) 238 247 << clrOutBOLD(clrRED, "Configuration XML Error:") << " " 239 << mFileName << ": line " << line_num << " at position " << pos240 << std::endl << vprDEBUG_FLUSH;248 << expanded_filename << ": line " << line_num << " at position " 249 << pos << std::endl << vprDEBUG_FLUSH; 241 250 vprDEBUG_NEXT(vprDBG_ERROR, vprDBG_CRITICAL_LVL) 242 251 << "Error: " << errmsg << std::endl << vprDEBUG_FLUSH; 243 252 244 253 // Print out the actual failed XML. 245 std::ifstream errfile( mFileName.c_str());254 std::ifstream errfile(expanded_filename.c_str()); 246 255 if ( errfile ) 247 256 {
