MCPcopy Create free account
hub / github.com/SpartanJ/eepp / readProperty

Method readProperty

src/eepp/ui/css/stylesheetparser.cpp:202–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202int StyleSheetParser::readProperty( const std::string& css, ReadState& rs, std::size_t pos,
203 std::string& buffer ) {
204 std::string selectorName( buffer );
205
206 buffer.clear();
207
208 while ( pos < css.size() ) {
209 if ( css[pos] == '{' ) {
210 pos++;
211 continue;
212 } else if ( css[pos] == '}' ) {
213 selectorName = String::trim( selectorName );
214
215 StyleSheetSelectorParser selectorParse( selectorName );
216 StyleSheetPropertiesParser propertiesParser( buffer );
217
218 if ( !selectorParse.selectors.empty() ) {
219 for ( auto it = selectorParse.selectors.begin();
220 it != selectorParse.selectors.end(); ++it ) {
221 std::shared_ptr<StyleSheetStyle> node = std::make_shared<StyleSheetStyle>(
222 it->getName(), propertiesParser.getProperties(),
223 propertiesParser.getVariables(), mMediaQueryList );
224
225 mStyleSheet.addStyle( node );
226 }
227 }
228
229 rs = ReadingSelector;
230 return pos + 1;
231 }
232
233 if ( css[pos] != '\n' && css[pos] != '\r' && css[pos] != '\t' )
234 buffer += css[pos];
235
236 pos++;
237 }
238
239 return pos;
240}
241
242std::string StyleSheetParser::importCSS( std::string path,
243 std::vector<std::string>& importedList ) {

Callers

nothing calls this directly

Calls 7

addStyleMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected