]> git.ipfire.org Git - thirdparty/cups.git/blame - ppdc/ppdc-group.cxx
Remove old files.
[thirdparty/cups.git] / ppdc / ppdc-group.cxx
CommitLineData
ac884b6a
MS
1//
2// "$Id$"
3//
4// Group class for the CUPS PPD Compiler.
5//
6// Copyright 2007 by Apple Inc.
7// Copyright 2002-2005 by Easy Software Products.
8//
9// These coded instructions, statements, and computer programs are the
10// property of Apple Inc. and are protected by Federal copyright
11// law. Distribution and use rights are outlined in the file "LICENSE.txt"
12// which should have been included with this file. If this file is
13// file is missing or damaged, see the license at "http://www.cups.org/".
14//
15// Contents:
16//
17// ppdcGroup::ppdcGroup() - Create a new group.
18// ppdcGroup::ppdcGroup() - Copy a new group.
19// ppdcGroup::~ppdcGroup() - Destroy a group.
20// ppdcGroup::find_option() - Find an option in a group.
21//
22
23//
24// Include necessary headers...
25//
26
27#include "ppdc.h"
28
29
30//
31// 'ppdcGroup::ppdcGroup()' - Create a new group.
32//
33
34ppdcGroup::ppdcGroup(const char *n, // I - Name of group
35 const char *t) // I - Text of group
36{
37 name = new ppdcString(n);
38 text = new ppdcString(t);
39 options = new ppdcArray();
40}
41
42
43//
44// 'ppdcGroup::ppdcGroup()' - Copy a new group.
45//
46
47ppdcGroup::ppdcGroup(ppdcGroup *g) // I - Group template
48{
49 ppdcOption *o; // Current option
50
51
52 g->name->get();
53 g->text->get();
54
55 name = g->name;
56 text = g->text;
57
58 options = new ppdcArray();
59 for (o = (ppdcOption *)g->options->first(); o; o = (ppdcOption *)g->options->next())
60 options->add(new ppdcOption(o));
61}
62
63
64//
65// 'ppdcGroup::~ppdcGroup()' - Destroy a group.
66//
67
68ppdcGroup::~ppdcGroup()
69{
70 name->release();
71 text->release();
72 delete options;
73}
74
75
76//
77// 'ppdcGroup::find_option()' - Find an option in a group.
78//
79
80ppdcOption *
81ppdcGroup::find_option(const char *n) // I - Name of option
82{
83 ppdcOption *o; // Current option
84
85
86 for (o = (ppdcOption *)options->first(); o; o = (ppdcOption *)options->next())
87 if (!strcasecmp(n, o->name->value))
88 return (o);
89
90 return (0);
91}
92
93
94//
95// End of "$Id$".
96//