]>
git.ipfire.org Git - thirdparty/cups.git/blob - ppdc/ppdc-group.cxx
4 // Group class for the CUPS PPD Compiler.
6 // Copyright 2007 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() - 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.
24 // Include necessary headers...
31 // 'ppdcGroup::ppdcGroup()' - Create a new group.
34 ppdcGroup::ppdcGroup(const char *n
, // I - Name of group
35 const char *t
) // I - Text of group
37 name
= new ppdcString(n
);
38 text
= new ppdcString(t
);
39 options
= new ppdcArray();
44 // 'ppdcGroup::ppdcGroup()' - Copy a new group.
47 ppdcGroup::ppdcGroup(ppdcGroup
*g
) // I - Group template
49 ppdcOption
*o
; // Current option
58 options
= new ppdcArray();
59 for (o
= (ppdcOption
*)g
->options
->first(); o
; o
= (ppdcOption
*)g
->options
->next())
60 options
->add(new ppdcOption(o
));
65 // 'ppdcGroup::~ppdcGroup()' - Destroy a group.
68 ppdcGroup::~ppdcGroup()
77 // 'ppdcGroup::find_option()' - Find an option in a group.
81 ppdcGroup::find_option(const char *n
) // I - Name of option
83 ppdcOption
*o
; // Current option
86 for (o
= (ppdcOption
*)options
->first(); o
; o
= (ppdcOption
*)options
->next())
87 if (!strcasecmp(n
, o
->name
->value
))