]>
git.ipfire.org Git - thirdparty/cups.git/blob - ppdc/ppdc-group.cxx
4 // Group class for the CUPS PPD Compiler.
6 // Copyright 2007-2009 by Apple Inc.
7 // Copyright 2002-2005 by Easy Software Products.
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/".
17 // ppdcGroup::ppdcGroup() - Copy a new group.
18 // ppdcGroup::~ppdcGroup() - Destroy a group.
19 // ppdcGroup::find_option() - Find an option in a group.
23 // Include necessary headers...
30 // 'ppdcGroup::ppdcGroup()' - Create a new group.
33 ppdcGroup::ppdcGroup(const char *n
, // I - Name of group
34 const char *t
) // I - Text of group
38 name
= new ppdcString(n
);
39 text
= new ppdcString(t
);
40 options
= new ppdcArray();
45 // 'ppdcGroup::ppdcGroup()' - Copy a new group.
48 ppdcGroup::ppdcGroup(ppdcGroup
*g
) // I - Group template
50 ppdcOption
*o
; // Current option
61 options
= new ppdcArray();
62 for (o
= (ppdcOption
*)g
->options
->first(); o
; o
= (ppdcOption
*)g
->options
->next())
63 options
->add(new ppdcOption(o
));
68 // 'ppdcGroup::~ppdcGroup()' - Destroy a group.
71 ppdcGroup::~ppdcGroup()
82 // 'ppdcGroup::find_option()' - Find an option in a group.
86 ppdcGroup::find_option(const char *n
) // I - Name of option
88 ppdcOption
*o
; // Current option
91 for (o
= (ppdcOption
*)options
->first(); o
; o
= (ppdcOption
*)options
->next())
92 if (!strcasecmp(n
, o
->name
->value
))