Exemple #1
0
// ------------------------------------------------------------------------------------------------
// Helper function to build a list of all file extensions supported by ASSIMP
void Importer::GetExtensionList(aiString& szOut) const
{
    ASSIMP_BEGIN_EXCEPTION_REGION();
    std::set<std::string> str;
    for (std::vector<BaseImporter*>::const_iterator i =  pimpl->mImporter.begin();i != pimpl->mImporter.end();++i)  {
        (*i)->GetExtensionList(str);
    }

    for (std::set<std::string>::const_iterator it = str.begin();; ) {
        szOut.Append("*.");
        szOut.Append((*it).c_str());

        if (++it == str.end()) {
            break;
        }
        szOut.Append(";");
    }
    ASSIMP_END_EXCEPTION_REGION(void);
}
Exemple #2
0
// -----------------------------------------------------------------------------------
// Convert a name to standard XML format
void ConvertName(aiString& out, const aiString& in)
{
	out.length = 0;
	for (unsigned int i = 0; i < in.length; ++i)  {
		switch (in.data[i]) {
			case '<':
				out.Append("&lt;");break;
			case '>':
				out.Append("&gt;");break;
			case '&':
				out.Append("&amp;");break;
			case '\"':
				out.Append("&quot;");break;
			case '\'':
				out.Append("&apos;");break;
			default:
				out.data[out.length++] = in.data[i];
		}
	}
	out.data[out.length] = 0;
}