/*************************************************************************** * Copyright (C) 2003 by Gulmini Luciano * * gulmini.luciano@student.unife.it * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "cssshpropertyparser.h" #include //#include CSSSHPropertyParser::CSSSHPropertyParser(const TQString& s){ TQStringList l1, l2=TQStringList::split(",",s); for ( TQStringList::Iterator it = l2.begin(); it != l2.end(); ++it ) { TQString temp; temp=removeBeginningWhiteSpaces((*it)); temp=removeEndingWhiteSpaces(temp); l1.append(temp); } m_propertyToParse = l1.join(",");// we eliminte blanks before after a comma in things like "something" , something , serif } CSSSHPropertyParser::~CSSSHPropertyParser(){} TQString CSSSHPropertyParser::removeEndingWhiteSpaces(const TQString& s){ int index = s.length()-1; while(s[index] == ' ' ) index--; return s.left(index+1); } TQString CSSSHPropertyParser::removeBeginningWhiteSpaces(const TQString& s){ int index = 0; while(s[index] == ' ' ) index++; return s.right(s.length()-index); } TQString CSSSHPropertyParser::extractFunctionList(){ TQRegExp functionListPattern("\\s*([a-zA-Z0-9_]*\\([\\W\\w]*\\))\\s*"); functionListPattern.search(m_propertyToParse); return functionListPattern.cap(1); } TQString CSSSHPropertyParser::extractQuotedStringList(){ TQString temp; bool stop = false; unsigned int i=0; while(!stop && i