]>
git.ipfire.org Git - thirdparty/cups.git/blob - ppdc/ppdc-group.cxx
2 // Group class for the CUPS PPD Compiler.
4 // Copyright 2007-2011 by Apple Inc.
5 // Copyright 2002-2005 by Easy Software Products.
7 // These coded instructions, statements, and computer programs are the
8 // property of Apple Inc. and are protected by Federal copyright
9 // law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 // which should have been included with this file. If this file is
11 // file is missing or damaged, see the license at "http://www.cups.org/".
15 // Include necessary headers...
18 #include "ppdc-private.h"
22 // 'ppdcGroup::ppdcGroup()' - Create a new group.
25 ppdcGroup::ppdcGroup(const char *n
, // I - Name of group
26 const char *t
) // I - Text of group
30 name
= new ppdcString(n
);
31 text
= new ppdcString(t
);
32 options
= new ppdcArray();
37 // 'ppdcGroup::ppdcGroup()' - Copy a new group.
40 ppdcGroup::ppdcGroup(ppdcGroup
*g
) // I - Group template
42 PPDC_NEWVAL(g
->name
->value
);
50 options
= new ppdcArray();
51 for (ppdcOption
*o
= (ppdcOption
*)g
->options
->first();
53 o
= (ppdcOption
*)g
->options
->next())
54 options
->add(new ppdcOption(o
));
59 // 'ppdcGroup::~ppdcGroup()' - Destroy a group.
62 ppdcGroup::~ppdcGroup()
64 PPDC_DELETEVAL(name
? name
->value
: NULL
);
76 // 'ppdcGroup::find_option()' - Find an option in a group.
80 ppdcGroup::find_option(const char *n
) // I - Name of option
82 ppdcOption
*o
; // Current option
85 for (o
= (ppdcOption
*)options
->first(); o
; o
= (ppdcOption
*)options
->next())
86 if (!_cups_strcasecmp(n
, o
->name
->value
))