• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Contraint class for the CUPS PPD Compiler.
3 //
4 // Copyright 2007-2009 by Apple Inc.
5 // Copyright 2002-2005 by Easy Software Products.
6 //
7 // Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
8 //
9 
10 //
11 // Include necessary headers...
12 //
13 
14 #include "ppdc-private.h"
15 
16 
17 //
18 // 'ppdcConstraint::ppdcConstraint()' - Create a constraint.
19 //
20 
ppdcConstraint(const char * o1,const char * c1,const char * o2,const char * c2)21 ppdcConstraint::ppdcConstraint(const char *o1,	// I - First option
22                                const char *c1,	// I - First choice
23 			       const char *o2,	// I - Second option
24 			       const char *c2)	// I - Second choice
25   : ppdcShared()
26 {
27   PPDC_NEW;
28 
29   option1 = new ppdcString(o1);
30   choice1 = new ppdcString(c1);
31   option2 = new ppdcString(o2);
32   choice2 = new ppdcString(c2);
33 }
34 
35 
36 //
37 // 'ppdcConstraint::~ppdcConstraint()' - Destroy a constraint.
38 //
39 
~ppdcConstraint()40 ppdcConstraint::~ppdcConstraint()
41 {
42   PPDC_DELETE;
43 
44   option1->release();
45   choice1->release();
46   option2->release();
47   choice2->release();
48 }
49