summaryrefslogtreecommitdiff
path: root/client/docgen/parse.cc
diff options
context:
space:
mode:
authordeva <deva>2011-06-14 12:59:50 +0000
committerdeva <deva>2011-06-14 12:59:50 +0000
commit72b7577583c0bdcc3b2b78687092b448e73a2e98 (patch)
tree1cad6420138d5ebe11f5e6deff781887177d92b9 /client/docgen/parse.cc
parenta949a28ef255983bf1b3b52eb90f1859240a897b (diff)
Create screenshots from xml code in the annotations.
Diffstat (limited to 'client/docgen/parse.cc')
-rw-r--r--client/docgen/parse.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/client/docgen/parse.cc b/client/docgen/parse.cc
index 6303eae..64c2aa7 100644
--- a/client/docgen/parse.cc
+++ b/client/docgen/parse.cc
@@ -40,6 +40,7 @@ typedef enum {
inmethex,
inpar,
inret,
+ inscrsht
} state_t;
static QString convert(QString in)
@@ -87,7 +88,6 @@ static QString convert(QString in)
Doc parse(QString filename)
{
Doc doc;
- doc.screenshot = false;
doc.container = false;
QFileInfo fi(filename);
@@ -116,6 +116,7 @@ Doc parse(QString filename)
line.remove(QRegExp("^[ \t]*[*][ \t]"));
if(state == indesc && line.left(1) == "@") state = none;
+ if(state == inscrsht && line.left(1) == "@") state = none;
if(state == indescex && line.left(1) == "@") state = none;
if(state == inatt && line.left(1) == "@") state = none;
if(state == inpar && line.left(1) == "@") state = inmeth;
@@ -139,7 +140,10 @@ Doc parse(QString filename)
}
if(state == none && line.left(11) == "@screenshot") {
- doc.screenshot = true;
+ Screenshot s;
+ s.caption = line.right(line.length() - 11);
+ doc.screenshots.push_back(s);
+ state = inscrsht;
continue;
}
@@ -157,6 +161,12 @@ Doc parse(QString filename)
continue;
}
+ if(state == inscrsht) {
+ Screenshot &s = doc.screenshots[doc.screenshots.size() - 1];
+ s.xml += line + "\n";
+ continue;
+ }
+
if((state == none || state == indesc || state == inmeth)
&& line.left(8) == "@example") {