示例#1
0
///Разбор подключаемого узла
  void PrepareIncludeNode (const ParseNode& decl)
  {
    const char* source_name = get<const char*> (decl, "source");

    bool ignore_unavailability = strcmp (get<const char*> (decl, "ignore_unavailability", "false"), "true") == 0;
    
    if (!source_name)
      return;
      
      //попытка найти в списке уже загруженных
      
    IncludeMap::iterator iter = includes.find (source_name);
    
    if (iter != includes.end ())
      return;

      //парсинг

    if (!FileSystem::IsFileExist (source_name) && ignore_unavailability)
      return;

    common::ParseLog root_log = root.Log ();

    Parser parser (root_log, source_name, "xml");
    
    const ParseNode& xscene_root = parser.Root ().First ();
    
    if (strcmp (xscene_root.Name (), XSCENE_ROOT))
      throw xtl::format_operation_exception ("", "Bad XML scene file '%s'. Root node not found", source_name);
      
    bool partial = strcmp (get<const char*> (xscene_root, "partial", ""), "true") == 0;

    if (!partial)
      throw xtl::format_operation_exception ("", "Bad XML scene file '%s'. Only partial definitions are allowed in this context", source_name);            

      //сохранение ссылки на подключаемый файл
      
    includes.insert_pair (source_name, xscene_root);
    
      //вложенный разбор
      
    Prepare (xscene_root);
  }
示例#2
0
 const_iterator end() const 	{
   return includeMap.end(); 
 }
示例#3
0
 iterator end() {
   return includeMap.end(); 
 }