~ubuntu-branches/ubuntu/jaunty/debtags/jaunty

« back to all changes in this revision

Viewing changes to tools/Ept.tcc

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-06-14 12:25:35 UTC
  • Revision ID: james.westby@ubuntu.com-20070614122535-m6bjawdvw9e6lfuk
Tags: 1.7.0ubuntu1
* Merge with Debian, remaining changes:
 - edit sources.list to use /usr/share/debtags instead of apt:/
 - include vocabulary.gz installed to /usr/share/debtags (edit Makefile.am)
 - edit get_tabs and get_vocabulary to use anonymous svn and rerun autogen.sh

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * debtags - Implement package tags support for Debian
3
 
 *
4
 
 * Copyright (C) 2003--2006  Enrico Zini <enrico@debian.org>
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; either version 2 of the License, or
9
 
 * (at your option) any later version.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 
 */
20
 
 
21
 
#include "Ept.h"
22
 
 
23
 
#include <tagcoll/input/stdio.h>
24
 
#include <tagcoll/TextFormat.h>
25
 
 
26
 
 
27
 
template<typename OUT>
28
 
void Ept::readCollection(const string& file, const OUT& out)
29
 
{
30
 
        if (file == "-")
31
 
        {
32
 
                input::Stdio input(stdin, "<stdin>");
33
 
                textformat::parse(input, ept::t::cache::debtags::stringToEpt<ept::configuration::Apt>(agg, this->vocabulary(), out));
34
 
        }
35
 
        else
36
 
        {
37
 
                input::Stdio input(file);
38
 
                textformat::parse(input, ept::t::cache::debtags::stringToEpt<ept::configuration::Apt>(agg, this->vocabulary(), out));
39
 
        }
40
 
}
41
 
 
42
 
template<typename OUT>
43
 
void Ept::readCollectionRaw(const string& file, const OUT& out)
44
 
{
45
 
        if (file == "-")
46
 
        {
47
 
                input::Stdio input(stdin, "<stdin>");
48
 
                textformat::parse(input, out);
49
 
        }
50
 
        else
51
 
        {
52
 
                input::Stdio input(file);
53
 
                textformat::parse(input, out);
54
 
        }
55
 
}
56
 
 
57
 
// vim:set ts=4 sw=4: