Example #1
0
brion::URIs BlueConfig::getTargetSources() const
{
    const std::string& run = _impl->getRun();

    URIs uris;
    const std::string& nrnPath =
        get(brion::CONFIGSECTION_RUN, run, BLUECONFIG_NRN_PATH_KEY);
    if (!nrnPath.empty())
    {
        URI uri;
        uri.setScheme("file");
        uri.setPath(nrnPath + "/" + CIRCUIT_TARGET_FILE);
        uris.push_back(uri);
    }

    const std::string& targetPath =
        get(brion::CONFIGSECTION_RUN, run, BLUECONFIG_TARGET_FILE_KEY);
    if (!targetPath.empty())
    {
        URI uri;
        uri.setScheme("file");
        uri.setPath(targetPath);
        uris.push_back(uri);
    }

    return uris;
}
Example #2
0
/// Convert an AS object to an XML string.
std::string
ExternalInterface::_objectToXML(as_object *obj)
{
    // GNASH_REPORT_FUNCTION;

    if ( ! _visited.insert(obj).second ) { 
        return "<circular/>";
    }
    
    std::stringstream ss;

    ss << "<object>";

    if (obj) {
        // Get all the properties
        VM& vm = getVM(*obj);
        string_table& st = vm.getStringTable();
        typedef std::vector<ObjectURI> URIs;
        URIs uris;
        Enumerator en(uris);
        obj->visitKeys(en);
        for (URIs::const_reverse_iterator i = uris.rbegin(), e = uris.rend();
                i != e; ++i) {
            as_value val = getMember(*obj, *i); 
            const std::string& id = i->toString(st);
            ss << "<property id=\"" << id << "\">";
            ss << _toXML(val);
            ss << "</property>";
        }
    }

    ss << "</object>";
    
    return ss.str();
}
Example #3
0
URIs Circuit::getMorphologyURIs( const GIDSet& gids ) const
{
    const Strings& names = _impl->getMorphologyNames( gids );

    URIs uris;
    uris.reserve( names.size( ));
    for( Strings::const_iterator i = names.begin(); i < names.end(); ++i )
       uris.push_back( _impl->getMorphologyURI( *i ));
    return uris;
}