List of all members.
Detailed Description
Definition at line 28 of file CssUtils.
Member Function Documentation
Config CssUtils::readConfig |
( |
std::istream & |
in | ) |
[static] |
Definition at line 29 of file CssUtils.cpp.
{
std::stringstream buf;
buf << in.rdbuf();
std::string css;
css = buf.str();
Config conf( "css" );
StringTokenizer blockIzer( "{}", "" );
blockIzer.addQuotes( "'\"", true );
StringTokenizer propSetIzer( ";", "" );
propSetIzer.addQuotes( "'\"", true );
StringTokenizer propIzer( ":", "'\"" );
propIzer.addQuotes( "()", true );
StringVector blocks;
blockIzer.tokenize( css, blocks );
for( unsigned i=0; i<blocks.size(); )
{
const std::string& name = blocks[i++];
if ( i < blocks.size() )
{
Config elementConf( name );
StringVector propSet;
propSetIzer.tokenize( blocks[i++], propSet );
for( unsigned j=0; j<propSet.size(); ++j )
{
StringVector prop;
propIzer.tokenize( propSet[j], prop );
if ( prop.size() == 2 )
{
elementConf.attr( prop[0] ) = prop[1];
}
}
conf.add( elementConf );
}
}
return conf;
}
The documentation for this class was generated from the following files:
- /home/cube/sources/osgearth/src/osgEarthSymbology/CssUtils
- /home/cube/sources/osgearth/src/osgEarthSymbology/CssUtils.cpp