ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Iffy/Iffy.cpp
(Generate patch)

Comparing Iffy/Iffy.cpp (file contents):
Revision 278 by Douglas Thrift, 2004-11-13T14:04:03-08:00 vs.
Revision 281 by Douglas Thrift, 2004-11-14T14:41:47-08:00

# Line 82 | Line 82 | bool Iffy::debug(false);
82  
83   void Iffy::iffy(ios::Reader& in, ios::Writer& out)
84   {
85        ext::String segment;
86        bool text(true);
85          ios::FormatWriter fout(out);
86 +
87 +        fout << "<html>";
88 +
89 +        ext::String segment;
90 +        bool text(false);
91          ext::Stack<ext::String> opens;
92  
93 <        while (read(in, segment, text)) if (text)
93 >        while (read(in, segment, (text = !text))) if (text)
94          {
95                  fout << segment;
93
94                text = false;
96          }
97          else
98          {
99 +                Matcher matcher;
100 +
101 +                if (segment == matcher("^!--( \\(\\d{1,2}:\\d{2}:\\d{2} [AP]M\\))--$"))
102 +                {
103 +                        fout << matcher[1];
104 +
105 +                        continue;
106 +                }
107 +
108                  Tag tag(segment);
109  
110                  if (tag == "br") tag = STANDALONE;
# Line 116 | Line 126 | void Iffy::iffy(ios::Reader& in, ios::Wr
126                  }
127  
128                  fout << tag;
119
120                text = true;
129          }
130 +
131 +        fout << "</html>\n";
132   }
133  
134   bool Iffy::read(ios::Reader& in, ext::String& segment, bool text)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines