1 /*- 2 * Copyright (c) 2004 Jacques A. Vidrine 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 #ifndef CELABO_20040211_PROCESSORS_HH 28 #define CELABO_20040211_PROCESSORS_HH 29 namespace vuxml { 30 31 32 class AllMatcher : public EntryProcessor { 33 public: 34 AllMatcher(EntryProcessor &proc); 35 virtual bool operator()(const Entry &entry); 36 virtual void start(); 37 virtual void end(); 38 private: 39 EntryProcessor &proc_; 40 }; 41 42 43 class VersionMatcher : public EntryProcessor { 44 public: 45 VersionMatcher(std::vector<std::string> &args, EntryProcessor &proc); 46 virtual bool operator()(const Entry &entry); 47 virtual void start(); 48 virtual void end(); 49 private: 50 std::vector<std::string> &args_; 51 EntryProcessor &proc_; 52 }; 53 54 55 class TextWriter : public EntryProcessor { 56 public: 57 TextWriter(std::ostream &os); 58 virtual bool operator()(const Entry &entry); 59 private: 60 std::ostream &os_; 61 }; 62 63 64 class VuXMLWriter : public EntryProcessor { 65 public: 66 VuXMLWriter(std::ostream &os); 67 virtual bool operator()(const Entry &entry); 68 virtual void start(); 69 virtual void end(); 70 private: 71 std::ostream &os_; 72 }; 73 74 75 class XHTMLWriter : public EntryProcessor { 76 public: 77 XHTMLWriter(std::ostream &os, unsigned int h1); 78 virtual bool operator()(const Entry &entry); 79 virtual void start(); 80 virtual void end(); 81 private: 82 std::ostream &os_; 83 unsigned int h1_; 84 }; 85 86 87 class XHTMLFilesWriter : public EntryProcessor { 88 public: 89 XHTMLFilesWriter(const std::string &dir); 90 virtual bool operator()(const Entry &entry); 91 private: 92 std::string dir_; 93 unsigned int fails_; 94 }; 95 96 97 } 98 #endif 99