Allow parse CSS from string.

--HG--
branch : dev
This commit is contained in:
Martín Lucas Golini
2019-01-17 02:42:25 -03:00
parent 98b9467c4d
commit 02c8afee20
2 changed files with 9 additions and 0 deletions

View File

@@ -31,6 +31,8 @@ class EE_API StyleSheetParser {
bool loadFromPack( Pack * pack, std::string filePackPath );
bool loadFromString( const std::string& str );
void print();
StyleSheet& getStyleSheet();

View File

@@ -66,6 +66,13 @@ void StyleSheetParser::print() {
}
}
bool StyleSheetParser::loadFromString( const std::string& str ) {
if ( str.empty() )
return false;
return loadFromMemory( (const Uint8*)&str[0], str.size() );
}
StyleSheet &StyleSheetParser::getStyleSheet() {
return mStyleSheet;
}