本文整理汇总了C++中configset::iterator::referrer方法的典型用法代码示例。如果您正苦于以下问题:C++ iterator::referrer方法的具体用法?C++ iterator::referrer怎么用?C++ iterator::referrer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类configset::iterator
的用法示例。
在下文中一共展示了iterator::referrer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: uri
void
StyleSheet::mergeConfig( const Config& conf )
{
_uriContext = URIContext( conf.referrer() );
// read in any resource library references
ConfigSet libraries = conf.children( "library" );
for( ConfigSet::iterator i = libraries.begin(); i != libraries.end(); ++i )
{
std::string name = i->value("name");
if ( name.empty() ) {
OE_WARN << LC << "Resource library missing required 'name' attribute" << std::endl;
continue;
}
URI uri( i->value("url"), i->referrer() );
if ( uri.empty() ) {
OE_WARN << LC << "Resource library missing required 'url' element" << std::endl;
continue;
}
_resLibs[name] = ResourceLibraryEntry(uri, (osgEarth::Symbology::ResourceLibrary*)0L);
//addResourceLibrary( name, reslib.get() );
}
// read in any scripts
ConfigSet scripts = conf.children( "script" );
for( ConfigSet::iterator i = scripts.begin(); i != scripts.end(); ++i )
{
// get the script code
std::string code = i->value();
// name is optional and unused at the moment
std::string name = i->value("name");
std::string lang = i->value("language");
if ( lang.empty() ) {
// default to javascript
lang = "javascript";
}
_script = new Script(code, lang, name);
}
// read any style class definitions. either "class" or "selector" is allowed
ConfigSet selectors = conf.children( "selector" );
if ( selectors.empty() ) selectors = conf.children( "class" );
for( ConfigSet::iterator i = selectors.begin(); i != selectors.end(); ++i )
{
_selectors.push_back( StyleSelector( *i ) );
}
// read in the actual styles
ConfigSet styles = conf.children( "style" );
for( ConfigSet::iterator i = styles.begin(); i != styles.end(); ++i )
{
const Config& styleConf = *i;
if ( styleConf.value("type") == "text/css" )
{
// read the inline data:
std::string cssString = styleConf.value();
// if there's a URL, read the CSS from the URL:
if ( styleConf.hasValue("url") )
{
URI uri( styleConf.value("url"), styleConf.referrer() );
cssString = uri.readString().getString();
}
// a CSS style definition can actually contain multiple styles. Read them
// and create one style for each in the catalog.
std::stringstream buf( cssString );
Config css = CssUtils::readConfig( buf );
css.setReferrer( styleConf.referrer() );
const ConfigSet children = css.children();
for(ConfigSet::const_iterator j = children.begin(); j != children.end(); ++j )
{
Style style( styleConf );
if ( SLDReader::readStyleFromCSSParams( *j, style ) )
_styles[ j->key() ] = style;
}
}
else
{
Style style( styleConf );
_styles[ style.getName() ] = style;
}
}
}