summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c8a7ccd)
raw | patch | inline | side by side (parent: c8a7ccd)
author | ishmal <ishmal@users.sourceforge.net> | |
Thu, 1 May 2008 19:28:19 +0000 (19:28 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Thu, 1 May 2008 19:28:19 +0000 (19:28 +0000) |
src/dom/cssreader.cpp | patch | blob | history | |
src/dom/cssreader.h | patch | blob | history | |
src/dom/svgreader.cpp | patch | blob | history |
diff --git a/src/dom/cssreader.cpp b/src/dom/cssreader.cpp
index b3302ddbd9f39db45adf5d29af3604baab87ca57..26588178112f69f1c76216d0cc611c3c42109ba0 100644 (file)
--- a/src/dom/cssreader.cpp
+++ b/src/dom/cssreader.cpp
/**
* Get the column and row number of the given character position
*/
-void CssParser::getColumnAndRow(int p, int &colResult, int &rowResult, int &lastNL)
+void CssReader::getColumnAndRow(int p, int &colResult, int &rowResult, int &lastNL)
{
int col = 1;
int row = 1;
/**
*
*/
-void CssParser::error(char const *fmt, ...)
+void CssReader::error(char const *fmt, ...)
{
int lineNr;
int colNr;
getColumnAndRow(lastPosition, colNr, lineNr, lastNL);
va_list args;
- fprintf(stderr, "CssParser:error at %d, line %d, column %d:",
+ fprintf(stderr, "CssReader:error at %d, line %d, column %d:",
lastPosition, lineNr, colNr);
va_start(args, fmt);
vfprintf(stderr, fmt, args);
/**
* Get the character at the position and record the fact
*/
-XMLCh CssParser::get(int p)
+XMLCh CssReader::get(int p)
{
if (p >= parselen)
return 0;
* Test if the given substring exists at the given position
* in parsebuf. Use get() in case of out-of-bounds
*/
-bool CssParser::match(int pos, const char *str)
+bool CssReader::match(int pos, const char *str)
{
while (*str)
{
/**
*
*/
-int CssParser::skipwhite(int p)
+int CssReader::skipwhite(int p)
{
while (p < parselen)
{
/**
* get a word from the buffer
*/
-int CssParser::getWord(int p, DOMString &result)
+int CssReader::getWord(int p, DOMString &result)
{
XMLCh ch = get(p);
if (!uni_is_letter(ch))
/**
* get a word from the buffer
*/
-int CssParser::getNumber(int p0, double &result)
+int CssReader::getNumber(int p0, double &result)
{
int p=p0;
DOMString str;
* Assume that we are starting on a quote. Ends on the char
* after the final '"'
*/
-int CssParser::getQuoted(int p0, DOMString &result)
+int CssReader::getQuoted(int p0, DOMString &result)
{
int p = p0;
/**
* Not in api. replaces URI return by lexer
*/
-int CssParser::getUri(int p0, DOMString &str)
+int CssReader::getUri(int p0, DOMString &str)
{
int p = p0;
if (!match(p, "url("))
/**
* Skip to the end of the block
*/
-int CssParser::skipBlock(int p0)
+int CssReader::skipBlock(int p0)
{
int p = p0;
while (p < parselen)
* [ [ ruleset | media | page ] [S|CDO|CDC]* ]*
* ;
*/
-int CssParser::getStyleSheet(int p0)
+int CssReader::getStyleSheet(int p0)
{
int p = p0;
int p2 = p;
* [STRING|URI] S* [ medium [ COMMA S* medium]* ]? ';' S*
* ;
*/
-int CssParser::getImport(int p0)
+int CssReader::getImport(int p0)
{
int p = p0;
if (!match(p, "@import"))
* : MEDIA_SYM S* medium [ COMMA S* medium ]* LBRACE S* ruleset* '}' S*
* ;
*/
-int CssParser::getMedia(int p0)
+int CssReader::getMedia(int p0)
{
int p = p0;
XMLCh ch;
* : IDENT S*
* ;
*/
-int CssParser::getMedium(int p0)
+int CssReader::getMedium(int p0)
{
int p = p0;
p = skipwhite(p);
* LBRACE S* declaration [ ';' S* declaration ]* '}' S*
* ;
*/
-int CssParser::getPage(int p0)
+int CssReader::getPage(int p0)
{
int p = p0;
* : ':' IDENT
* ;
*/
-int CssParser::getPseudoPage(int p0)
+int CssReader::getPseudoPage(int p0)
{
int p = p0;
if (!match(p, ":"))
* LBRACE S* declaration [ ';' S* declaration ]* '}' S*
* ;
*/
-int CssParser::getRuleSet(int p0)
+int CssReader::getRuleSet(int p0)
{
int p = p0;
XMLCh ch;
* : simple_selector [ combinator simple_selector ]*
* ;
*/
-int CssParser::getSelector(int p0)
+int CssReader::getSelector(int p0)
{
int p = p0;
* | [ HASH | class | attrib | pseudo ]+
* ;
*/
-int CssParser::getSimpleSelector(int p0)
+int CssReader::getSimpleSelector(int p0)
{
int p = p0;
int p2;
* | {empty}
* ;
*/
-int CssParser::getDeclaration(int p0, CSSStyleDeclaration &declarationList)
+int CssReader::getDeclaration(int p0, CSSStyleDeclaration &declarationList)
{
int p = p0;
* : IMPORTANT_SYM S*
* ;
*/
-int CssParser::getPrio(int p0, DOMString &val)
+int CssReader::getPrio(int p0, DOMString &val)
{
int p = p0;
* : term [ operator term ]*
* ;
*/
-int CssParser::getExpr(int p0)
+int CssReader::getExpr(int p0)
{
int p = p0;
* | STRING S* | IDENT S* | URI S* | hexcolor
* ;
*/
-int CssParser::getTerm(int p0)
+int CssReader::getTerm(int p0)
{
int p = p0;
p = skipwhite(p);
* : FUNCTION S* expr ')' S*
* ;
*/
-int CssParser::getFunction(int p0)
+int CssReader::getFunction(int p0)
{
int p = p0;
* : HASH S*
* ;
*/
-int CssParser::getHexColor(int p0)
+int CssReader::getHexColor(int p0)
{
int p = p0;
/**
*
*/
-bool CssParser::parse(const DOMString &str)
+bool CssReader::parse(const DOMString &str)
{
/*
int len = str.size();
/**
*
*/
-bool CssParser::parseFile(const DOMString &fileName)
+bool CssReader::parseFile(const DOMString &fileName)
{
DOMString tmp = fileName;
char *fname = (char *)tmp.c_str();
int main(int argc, char **argv)
{
- org::w3c::dom::css::CssParser parser;
+ org::w3c::dom::css::CssReader parser;
char *fileName;
fileName = "001.css";
//fileName = "acid.css";
diff --git a/src/dom/cssreader.h b/src/dom/cssreader.h
index 1569ab858b9aa1b702033cc18158ec012b05ccb4..149db31efe699a43fd2ea65221c9f96b0a2fdf98 100644 (file)
--- a/src/dom/cssreader.h
+++ b/src/dom/cssreader.h
namespace css
{
-class CssParser
+class CssReader
{
public:
/**
*
*/
- CssParser()
+ CssReader()
{}
/**
*
*/
- virtual ~CssParser()
+ virtual ~CssReader()
{}
/**
diff --git a/src/dom/svgreader.cpp b/src/dom/svgreader.cpp
index 7ebde97aededa5a38a6bd1674a898b396bd5989b..4fd0817432bdb0ac62945829411d5334ac5a3fa8 100644 (file)
--- a/src/dom/svgreader.cpp
+++ b/src/dom/svgreader.cpp
DOMString style = sourceElem->getAttribute("style");
if (style.size() > 0)
{
- css::CssParser parser;
+ css::CssReader parser;
style.insert(0, "{");
style.append("}");
//printf("CSS:%s\n", style.c_str());