Index: Core/Resources/resource_manager.cpp =================================================================== --- Core/Resources/resource_manager.cpp (revision 82) +++ Core/Resources/resource_manager.cpp (working copy) @@ -75,27 +75,27 @@ return res; } -std::list CL_ResourceManager::get_all_resources() +std::vector CL_ResourceManager::get_all_resources() { return impl->get_all_resources(); } -std::list CL_ResourceManager::get_all_resources(const std::string §ion_name) +std::vector CL_ResourceManager::get_all_resources(const std::string §ion_name) { return impl->get_all_resources(section_name); } -std::list CL_ResourceManager::get_all_sections() +std::vector CL_ResourceManager::get_all_sections() { return impl->get_all_sections(); } -std::list CL_ResourceManager::get_resources_of_type(const std::string &type_id) +std::vector CL_ResourceManager::get_resources_of_type(const std::string &type_id) { return impl->get_resources_of_type(type_id); } -std::list CL_ResourceManager::get_resources_of_type(const std::string &type_id, const std::string §ion_name) +std::vector CL_ResourceManager::get_resources_of_type(const std::string &type_id, const std::string §ion_name) { return impl->get_resources_of_type(type_id, section_name); } Index: Core/Resources/resource_manager_generic.h =================================================================== --- Core/Resources/resource_manager_generic.h (revision 82) +++ Core/Resources/resource_manager_generic.h (working copy) @@ -52,15 +52,15 @@ CL_Resource &get_resource(const std::string &res_id); - std::list get_all_resources(); + std::vector get_all_resources(); - std::list get_all_resources(const std::string §ion_name); + std::vector get_all_resources(const std::string §ion_name); - std::list get_all_sections(); + std::vector get_all_sections(); - std::list get_resources_of_type(const std::string &type_id); + std::vector get_resources_of_type(const std::string &type_id); - std::list get_resources_of_type(const std::string &type_id, const std::string §ion_name); + std::vector get_resources_of_type(const std::string &type_id, const std::string §ion_name); CL_InputSourceProvider *get_resource_provider() const { return provider; } @@ -91,7 +91,7 @@ void parse_section(CL_DomElement §ionElement, const std::string &prefix = std::string()); - void add_sections(std::list &returnList, CL_DomElement §ionElement, const std::string &prefix = std::string()); + void add_sections(std::vector &returnList, CL_DomElement §ionElement, const std::string &prefix = std::string()); //! Implementation: private: Index: Core/Resources/resource_manager_generic.cpp =================================================================== --- Core/Resources/resource_manager_generic.cpp (revision 82) +++ Core/Resources/resource_manager_generic.cpp (working copy) @@ -20,6 +20,7 @@ ** */ +#include #include "Core/precomp.h" #include "resource_manager_generic.h" #include "resource_generic.h" @@ -77,9 +78,9 @@ return it->second; } -std::list CL_ResourceManager_Generic::get_all_resources(const std::string &original_section_name) +std::vector CL_ResourceManager_Generic::get_all_resources(const std::string &original_section_name) { - std::list result; + std::vector result; // Make sure we have a trailing / in section std::string section_name = add_trailing_slash(original_section_name); @@ -101,17 +102,17 @@ std::list::iterator it; for (it = additional_resources.begin(); it != additional_resources.end(); ++it) { - std::list additionals = it->get_all_resources(section_name); - result.merge(additionals); + std::vector additionals = it->get_all_resources(section_name); + std::copy(additionals.begin(), additionals.end(), result.begin()); } } return result; } -std::list CL_ResourceManager_Generic::get_all_resources() +std::vector CL_ResourceManager_Generic::get_all_resources() { - std::list result; + std::vector result; // Add local resources: { @@ -127,17 +128,17 @@ std::list::iterator it; for (it = additional_resources.begin(); it != additional_resources.end(); ++it) { - std::list additionals = it->get_all_resources(); - result.merge(additionals); + std::vector additionals = it->get_all_resources(); + std::copy(additionals.begin(), additionals.end(), result.begin()); } } return result; } -std::list CL_ResourceManager_Generic::get_all_sections() +std::vector CL_ResourceManager_Generic::get_all_sections() { - std::list result; + std::vector result; // Add local sections: { @@ -156,17 +157,17 @@ std::list::iterator it; for (it = additional_resources.begin(); it != additional_resources.end(); ++it) { - std::list additionals = it->get_all_sections(); - result.merge(additionals); + std::vector additionals = it->get_all_sections(); + std::copy(additionals.begin(), additionals.end(), std::back_inserter(result)); } } return result; } -std::list CL_ResourceManager_Generic::get_resources_of_type(const std::string &type_id) +std::vector CL_ResourceManager_Generic::get_resources_of_type(const std::string &type_id) { - std::list result; + std::vector result; // Add local resources: { @@ -182,17 +183,17 @@ std::list::iterator it; for (it = additional_resources.begin(); it != additional_resources.end(); ++it) { - std::list additionals = it->get_resources_of_type(type_id); - result.merge(additionals); + std::vector additionals = it->get_resources_of_type(type_id); + std::copy(additionals.begin(), additionals.end(), std::back_inserter(result)); } } return result; } -std::list CL_ResourceManager_Generic::get_resources_of_type(const std::string &type_id, const std::string &original_section_name) +std::vector CL_ResourceManager_Generic::get_resources_of_type(const std::string &type_id, const std::string &original_section_name) { - std::list result; + std::vector result; // Make sure we have a trailing / in section std::string section_name = add_trailing_slash(original_section_name); @@ -214,8 +215,8 @@ std::list::iterator it; for (it = additional_resources.begin(); it != additional_resources.end(); ++it) { - std::list additionals = it->get_resources_of_type(type_id, section_name); - result.merge(additionals); + std::vector additionals = it->get_resources_of_type(type_id, section_name); + std::copy(additionals.begin(), additionals.end(), std::back_inserter(result)); } } @@ -404,7 +405,7 @@ } } -void CL_ResourceManager_Generic::add_sections(std::list &returnList, CL_DomElement §ionElement, const std::string &prefix) +void CL_ResourceManager_Generic::add_sections(std::vector &returnList, CL_DomElement §ionElement, const std::string &prefix) { std::string path = prefix + sectionElement.get_attribute("name") + "/"; if (sectionElement.get_tag_name() == "resources") path = prefix; Index: API/Core/Resources/resource_manager.h =================================================================== --- API/Core/Resources/resource_manager.h (revision 82) +++ API/Core/Resources/resource_manager.h (working copy) @@ -96,23 +96,23 @@ //: Returns a list of all resources available. //return: The list of resources available, in the form [section/subsection/.../]resourcename. - std::list get_all_resources(); + std::vector get_all_resources(); //: Returns a list of all resources available matching a given section. //return: The list of resources available, in the form [section/subsection/.../]resourcename. - std::list get_all_resources(const std::string §ion_name); + std::vector get_all_resources(const std::string §ion_name); //: Returns a list of all resource sections available. //return: The list of resources available, in the form [section/subsection/.../]. - std::list get_all_sections(); + std::vector get_all_sections(); //: Returns a list of all resources available matching a given type. //return: The list of resources available. - std::list get_resources_of_type(const std::string &type_id); + std::vector get_resources_of_type(const std::string &type_id); //: Returns a list of all resources available matching a given type in a given section. //return: The list of resources available. - std::list get_resources_of_type(const std::string &type_id, const std::string §ion_name); + std::vector get_resources_of_type(const std::string &type_id, const std::string §ion_name); //: Returns a pointer to the input source provider, in which all resources are stored. //-

This can be a file provider or a datafile provider depending