]>
git.ipfire.org Git - thirdparty/cups.git/blob - ppdc/ppdc-group.cxx
ee66caa70b564cf1f2ed6936c4b3510bcdcd646e
2 // Group class for the CUPS PPD Compiler.
4 // Copyright 2007-2011 by Apple Inc.
5 // Copyright 2002-2005 by Easy Software Products.
7 // Licensed under Apache License v2.0. See the file "LICENSE" for more information.
11 // Include necessary headers...
14 #include "ppdc-private.h"
18 // 'ppdcGroup::ppdcGroup()' - Create a new group.
21 ppdcGroup::ppdcGroup(const char *n
, // I - Name of group
22 const char *t
) // I - Text of group
26 name
= new ppdcString(n
);
27 text
= new ppdcString(t
);
28 options
= new ppdcArray();
33 // 'ppdcGroup::ppdcGroup()' - Copy a new group.
36 ppdcGroup::ppdcGroup(ppdcGroup
*g
) // I - Group template
38 PPDC_NEWVAL(g
->name
->value
);
46 options
= new ppdcArray();
47 for (ppdcOption
*o
= (ppdcOption
*)g
->options
->first();
49 o
= (ppdcOption
*)g
->options
->next())
50 options
->add(new ppdcOption(o
));
55 // 'ppdcGroup::~ppdcGroup()' - Destroy a group.
58 ppdcGroup::~ppdcGroup()
60 PPDC_DELETEVAL(name
? name
->value
: NULL
);
72 // 'ppdcGroup::find_option()' - Find an option in a group.
76 ppdcGroup::find_option(const char *n
) // I - Name of option
78 ppdcOption
*o
; // Current option
81 for (o
= (ppdcOption
*)options
->first(); o
; o
= (ppdcOption
*)options
->next())
82 if (!_cups_strcasecmp(n
, o
->name
->value
))