std::string CXBindingsGenerator::GetRealType( const std::string& typeBase , CXBindingsGeneratorOptions& options ) { std::string type = typeBase; if( boost::algorithm::contains(type,":") ) { type = after_first( type, ':' ); } std::string realType = type; std::string ns; if( IsKnownType( type ) ) { CXBindingsStringStringMap& types = m_genfile->GetTypeInfo().GetTypes(); CXBindingsStringStringMap::iterator it = types.find( type ); if( it == types.end() ) { return type; } return it->second; } if( boost::algorithm::contains(realType,":") ) { ns = before_first( realType , ':' ); realType = after_first( realType, ':' ); } //if( ns.empty() ) //ns = options.ns; realType = GetObjectName( realType , options ); //realType = ns + realType; CXBindingsStringStringMap& types = m_genfile->GetTypeInfo().GetTypes(); types[type] = realType; //wxLogMessage( type + " - ") + realType ; return realType; }
TXML::TXML(int f, int t, string & s, bool fix_comments) { from = f; to = t; closing = selfclosing = false; name = s.substr(from + 1, to - (from + 1)); trim(name); if (left(name, 1) == "/") { closing = true; name = name.substr(1, name.length() - 1); } if (right(name, 1) == "/") { selfclosing = true; name = name.substr(0, name.length() - 1); } name = before_first(' ', name); // This will replace < and > within a comment with the appropriate HTML entities if (fix_comments && left(name, 1) == "!") { int a; for (a = from + 1; a < to; a++) { if (s[a] != '>' && s[a] != '<') continue; to += 3; if (s[a] == '>') s.insert(a, ">"); if (s[a] == '<') s.insert(a, "<"); s[a + 3] = ';'; } } }