summaryrefslogtreecommitdiff
path: root/examples/filter.cpp
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-01-31 17:16:27 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-01-31 17:16:27 +0300
commit0be032c6998e712dc2c9f2ed97c3491d89eb05af (patch)
treef762d884147d2f0a9a115edd0b5e0de554a3ec1b /examples/filter.cpp
downloadxift-0be032c6998e712dc2c9f2ed97c3491d89eb05af.tar
xift-0be032c6998e712dc2c9f2ed97c3491d89eb05af.tar.xz
xift-0be032c6998e712dc2c9f2ed97c3491d89eb05af.zip
[xift] Almost done.
Diffstat (limited to 'examples/filter.cpp')
-rw-r--r--examples/filter.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/filter.cpp b/examples/filter.cpp
new file mode 100644
index 0000000..6e786c9
--- /dev/null
+++ b/examples/filter.cpp
@@ -0,0 +1,28 @@
+#include <file.hpp>
+#include <xift.hpp>
+
+
+int main()
+{
+ XiftFile exporter(stdout);
+ Xift xift(exporter);
+
+ xift.Tag("a").Attribute("href");
+ XiftTags::Tag &p = xift.Tag("p");
+ p.Attribute("class");
+ p.Attribute("hidden");
+ p.Attribute("id");
+ xift.Tag("script");
+
+ xift.Remove("script");
+ p.Remove("id");
+
+ xift.PutFile("message.html");
+
+ if (!xift.End()) {
+ printf("Error on %d line, %d column:\n%s",
+ xift.ErrorLine(), xift.ErrorColumn(), xift.Error());
+ }
+
+ return 0;
+}