8 cm( inst, this,
"XcfInfo" )
26 auto it = this->_layers.find( name );
27 if( it == this->_layers.end() )
36 void XcfInfo::Parse( std::istream & in )
39 lex.DefineKeyword(
"width" );
40 lex.DefineKeyword(
"height" );
41 lex.DefineKeyword(
"layer" );
42 lex.DisableNewlineSkipping();
47 while( !lex.Failed() && !lex.IsNext( Lex::Token::Eof ) )
49 if( lex.IsNextKeyword(
"width" ) )
51 lex.AcceptKeyword(
"width" );
52 int width = lex.AcceptDouble();
55 this->_size.x = float( width );
57 else if( lex.IsNextKeyword(
"height" ) )
59 lex.AcceptKeyword(
"height" );
60 int height = lex.AcceptDouble();
63 this->_size.y = float( height );
65 else if( lex.IsNextKeyword(
"layer" ) )
67 lex.AcceptKeyword(
"layer" );
71 int global_order = lex.AcceptDouble();
73 std::string name = lex.AcceptString();
75 layer.
size.x = float( lex.AcceptDouble() );
76 layer.
size.y = float( lex.AcceptDouble() );
89 this->_layers[ name ] =
layer;
93 lex.Accept( Lex::Token::Newline );
96 lex.Recover( Lex::Token::Newline );
97 lex.Accept( Lex::Token::Newline );